Skip to content

Commit

Permalink
Pass on PythonError handling that should be using PythonErrorFragment (
Browse files Browse the repository at this point in the history
…#7152)

Summary:
This ensures that we have the data we need to include inner exceptions.

Test Plan: Most of these are statically caught, but do a spot check on backfills and launching runs that raise errors
  • Loading branch information
gibsondan committed Mar 22, 2022
1 parent 01294b4 commit 6f10ab0
Show file tree
Hide file tree
Showing 55 changed files with 291 additions and 146 deletions.
8 changes: 4 additions & 4 deletions js_modules/dagit/packages/core/src/app/Telemetry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {print} from 'graphql';
import * as React from 'react';

import {AppContext} from './AppContext';
import {PYTHON_ERROR_FRAGMENT} from './PythonErrorInfo';

export enum TelemetryAction {
LAUNCH_RUN = 'LAUNCH_RUN',
Expand All @@ -15,12 +16,11 @@ const LOG_TELEMETRY_MUTATION = gql`
... on LogTelemetrySuccess {
action
}
... on PythonError {
message
stack
}
...PythonErrorFragment
}
}
${PYTHON_ERROR_FRAGMENT}
`;

export async function logTelemetry(
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions js_modules/dagit/packages/core/src/assets/AssetWipeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {gql, RefetchQueriesFunction, useMutation} from '@apollo/client';
import {ButtonWIP, DialogBody, DialogFooter, DialogWIP, Group} from '@dagster-io/ui';
import * as React from 'react';

import {PYTHON_ERROR_FRAGMENT} from '../app/PythonErrorInfo';
import {displayNameForAssetKey} from '../app/Util';

interface AssetKey {
Expand Down Expand Up @@ -67,10 +68,9 @@ const ASSET_WIPE_MUTATION = gql`
path
}
}
... on PythonError {
message
stack
}
...PythonErrorFragment
}
}
${PYTHON_ERROR_FRAGMENT}
`;

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions js_modules/dagit/packages/core/src/gantt/RunGroupPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {Link} from 'react-router-dom';
import styled from 'styled-components/macro';

import {showCustomAlert} from '../app/CustomAlertProvider';
import {PYTHON_ERROR_FRAGMENT} from '../app/PythonErrorInfo';
import {SidebarSection} from '../pipelines/SidebarComponents';
import {RunStatusIndicator} from '../runs/RunStatusDots';
import {DagsterTag} from '../runs/RunTag';
Expand Down Expand Up @@ -137,9 +138,7 @@ const RUN_GROUP_PANEL_QUERY = gql`
query RunGroupPanelQuery($runId: ID!) {
runGroupOrError(runId: $runId) {
__typename
... on PythonError {
message
}
...PythonErrorFragment
... on RunGroup {
rootRunId
runs {
Expand All @@ -159,6 +158,7 @@ const RUN_GROUP_PANEL_QUERY = gql`
}
}
${RUN_TIME_FRAGMENT}
${PYTHON_ERROR_FRAGMENT}
`;

const RunGroupRun = styled(Link)<{selected: boolean}>`
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {gql, useMutation} from '@apollo/client';
import {ButtonWIP, DialogBody, DialogFooter, DialogWIP} from '@dagster-io/ui';
import * as React from 'react';

import {PYTHON_ERROR_FRAGMENT} from '../app/PythonErrorInfo';
import {doneStatuses} from '../runs/RunStatuses';
import {TerminationDialog} from '../runs/TerminationDialog';
import {BulkActionStatus} from '../types/globalTypes';
Expand Down Expand Up @@ -84,9 +85,9 @@ const CANCEL_BACKFILL_MUTATION = gql`
... on CancelBackfillSuccess {
backfillId
}
... on PythonError {
message
}
...PythonErrorFragment
}
}
${PYTHON_ERROR_FRAGMENT}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,9 @@ const RESUME_BACKFILL_MUTATION = gql`
... on UnauthorizedError {
message
}
... on PythonError {
message
}
...PythonErrorFragment
}
}
${PYTHON_ERROR_FRAGMENT}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -614,9 +614,7 @@ const INSTANCE_OVERVIEW_INITIAL_QUERY = gql`
}
}
}
... on PythonError {
...PythonErrorFragment
}
...PythonErrorFragment
}
}
}
Expand Down Expand Up @@ -656,9 +654,7 @@ const LAST_TEN_RUNS_PER_JOB_QUERY = gql`
}
}
}
... on PythonError {
...PythonErrorFragment
}
...PythonErrorFragment
}
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,7 @@ const LAUNCHED_RUN_LIST_QUERY = gql`
... on InvalidPipelineRunsFilterError {
message
}
... on PythonError {
...PythonErrorFragment
}
...PythonErrorFragment
}
}
${RUN_TABLE_RUN_FRAGMENT}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,7 @@ const JOB_TICK_HISTORY_QUERY = gql`
...TickTagFragment
}
}
... on PythonError {
...PythonErrorFragment
}
...PythonErrorFragment
}
}
${PYTHON_ERROR_FRAGMENT}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,7 @@ const CONFIG_PARTITIONS_QUERY = gql`
name
}
}
... on PythonError {
...PythonErrorFragment
}
...PythonErrorFragment
}
}
}
Expand Down Expand Up @@ -447,9 +445,7 @@ export const CONFIG_PARTITION_SELECTION_QUERY = gql`
... on PartitionRunConfig {
yaml
}
... on PythonError {
...PythonErrorFragment
}
...PythonErrorFragment
}
mode
tagsOrError {
Expand All @@ -459,9 +455,7 @@ export const CONFIG_PARTITION_SELECTION_QUERY = gql`
value
}
}
... on PythonError {
...PythonErrorFragment
}
...PythonErrorFragment
}
}
}
Expand Down
10 changes: 4 additions & 6 deletions js_modules/dagit/packages/core/src/launchpad/LaunchpadRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as React from 'react';
import {Redirect, useParams} from 'react-router-dom';

import {usePermissions} from '../app/Permissions';
import {PYTHON_ERROR_FRAGMENT} from '../app/PythonErrorInfo';
import {explorerPathFromString, useStripSnapshotFromPath} from '../pipelines/PipelinePathUtils';
import {useJobTitle} from '../pipelines/useJobTitle';
import {isThisThingAJob, useRepository} from '../workspace/WorkspaceContext';
Expand Down Expand Up @@ -156,9 +157,7 @@ const PIPELINE_EXECUTION_ROOT_QUERY = gql`
... on PipelineNotFoundError {
message
}
... on PythonError {
message
}
...PythonErrorFragment
... on Pipeline {
id
...LaunchpadSessionContainerPipelineFragment
Expand All @@ -176,12 +175,11 @@ const PIPELINE_EXECUTION_ROOT_QUERY = gql`
... on PipelineNotFoundError {
message
}
... on PythonError {
message
}
...PythonErrorFragment
}
}
${EXECUTION_SESSION_CONTAINER_PIPELINE_FRAGMENT}
${EXECUTION_SESSION_CONTAINER_PARTITION_SETS_FRAGMENT}
${PYTHON_ERROR_FRAGMENT}
`;
6 changes: 3 additions & 3 deletions js_modules/dagit/packages/core/src/launchpad/OpSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as React from 'react';
import styled from 'styled-components/macro';

import {filterByQuery} from '../app/GraphQueryImpl';
import {PYTHON_ERROR_FRAGMENT} from '../app/PythonErrorInfo';
import {ShortcutHandler} from '../app/ShortcutHandler';
import {explodeCompositesInHandleGraph} from '../pipelines/CompositeSupport';
import {GRAPH_EXPLORER_SOLID_HANDLE_FRAGMENT} from '../pipelines/GraphExplorer';
Expand Down Expand Up @@ -46,12 +47,11 @@ const SOLID_SELECTOR_QUERY = gql`
... on InvalidSubsetError {
message
}
... on PythonError {
message
}
...PythonErrorFragment
}
}
${GRAPH_EXPLORER_SOLID_HANDLE_FRAGMENT}
${PYTHON_ERROR_FRAGMENT}
`;

export const OpSelector = (props: IOpSelectorProps) => {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6f10ab0

Please sign in to comment.