Skip to content

Commit

Permalink
Fix descriptor that only references solid (#8159)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpeng817 committed Jun 8, 2022
1 parent c6aa327 commit 9567e1e
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions python_modules/dagster/dagster/core/definitions/run_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def define_run_config_schema_type(creation_data: RunConfigSchemaCreationData) ->
solid_ignored=False,
direct_inputs=creation_data.direct_inputs,
asset_layer=creation_data.asset_layer,
is_using_graph_job_op_apis=creation_data.is_using_graph_job_op_apis,
),
}

Expand Down Expand Up @@ -187,6 +188,7 @@ def get_inputs_field(
resource_defs: Dict[str, ResourceDefinition],
solid_ignored: bool,
asset_layer: AssetLayer,
is_using_graph_job_op_apis: bool,
direct_inputs: Optional[Mapping[str, Any]] = None,
):
direct_inputs = check.opt_mapping_param(direct_inputs, "direct_inputs")
Expand All @@ -211,10 +213,11 @@ def get_inputs_field(
if not inputs_field_fields:
return None
if solid_ignored:
node_type = "op" if is_using_graph_job_op_apis else "solid"
return Field(
Shape(inputs_field_fields),
is_required=False,
description="This solid is not present in the current solid selection, "
description=f"This {node_type} is not present in the current {node_type} selection, "
"the input config values are allowed but ignored.",
)
else:
Expand Down Expand Up @@ -337,10 +340,11 @@ def solid_config_field(
trimmed_fields = remove_none_entries(fields)
if trimmed_fields:
if ignored:
node_type = "op" if is_using_graph_job_op_apis else "solid"
return Field(
Shape(trimmed_fields, field_aliases=field_aliases),
is_required=False,
description="This solid is not present in the current solid selection, "
description=f"This {node_type} is not present in the current {node_type} selection, "
"the config values are allowed but ignored.",
)
else:
Expand All @@ -362,7 +366,13 @@ def construct_leaf_solid_config(
return solid_config_field(
{
"inputs": get_inputs_field(
solid, handle, dependency_structure, resource_defs, ignored, asset_layer
solid,
handle,
dependency_structure,
resource_defs,
ignored,
asset_layer,
is_using_graph_job_op_apis,
),
"outputs": get_outputs_field(solid, resource_defs),
"config": config_schema.as_field() if config_schema else None,
Expand Down Expand Up @@ -431,6 +441,7 @@ def define_isolid_field(
resource_defs,
ignored,
asset_layer,
is_using_graph_job_op_apis,
),
"outputs": get_outputs_field(solid, resource_defs),
}
Expand Down

0 comments on commit 9567e1e

Please sign in to comment.