You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def create_execution_params(graphene_info, graphql_execution_params):
preset_name = graphql_execution_params.get('preset')
selector = PipelineSelector.from_graphql_input(
graphene_info.context, graphql_execution_params['selector']
)
if preset_name:
check.invariant(
not graphql_execution_params.get('environmentConfigData'),
'Invalid ExecutionParams. Cannot define environment_dict when using preset',
)
check.invariant(
not graphql_execution_params.get('mode'),
'Invalid ExecutionParams. Cannot define mode when using preset',
)
check.invariant(
not selector.solid_subset,
'Invalid ExecutionParams. Cannot define selector.solid_subset when using preset',
)
We do invariant checks that fail when we pass in properly formatted graphql. We should be throwing proper GraphQL errors. "check" errors are the moral equivalent of something akin to a typecheck failure, where as the errors above are more "business domain" errors. The computation has completed normally and has failed in an expected manner.
…cking codepath
Summary:
Continuing to move code over to the hijacking codepath. Found some weirdness
in that we are using check to commmunicate graphql domain errors.
Tracking here #2507
Depends on D3087
Test Plan: BK
Reviewers: alangenfeld, max
Reviewed By: alangenfeld
Differential Revision: https://dagster.phacility.com/D3088
For a bit more additional context, we want to introduce a new error type, similar to the PresetNotFoundError that's right after the code snippet defined above.
if not external_pipeline.has_preset(preset_name):
raise UserFacingGraphQLError(
graphene_info.schema.type_named('PresetNotFoundError')(
preset=preset_name, selector=selector
)
)
Instead of doing check.invariant, we'll want to raise a new UserFacingGraphQLError with a type describing this class of error where both a preset and one of environmentConfigData, mode or solidSubset is defined.
Summary:
When checking for conflicts between presets and execution params, return a GraphQL error type (ConflictingExecutionParamsError) instead of raising invariant errors. Ensure that these errors are caught and returned through gql result rather than simply raised.
See [[ #2507 | #2507 ]]
Test Plan: Updated unit tests in `python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_execute_pipeline.py` to match new error format.
Reviewers: sashank
Reviewed By: sashank
Differential Revision: https://dagster.phacility.com/D3559
In create_execution_params:
We do invariant checks that fail when we pass in properly formatted graphql. We should be throwing proper GraphQL errors. "check" errors are the moral equivalent of something akin to a typecheck failure, where as the errors above are more "business domain" errors. The computation has completed normally and has failed in an expected manner.
The fact that this is so odd is exposed here:
The text was updated successfully, but these errors were encountered: