Skip to content

Commit

Permalink
[external-assets] Rename FromSourceAsset -> FromLoadableAsset (#20546)
Browse files Browse the repository at this point in the history
## Summary & Motivation

Rename `FromSourceAsset` (a subclass of `StepInputSource`) to
`FromLoadableAsset`. This is clearer and more consistent with new
terminology in the codebase.

## How I Tested These Changes

Existing test suite.
  • Loading branch information
smackesey authored Mar 19, 2024
1 parent 36d484a commit 2263124
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions python_modules/dagster/dagster/_core/execution/plan/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ def compute_version(
raise NotImplementedError()


@whitelist_for_serdes(storage_field_names={"node_handle": "solid_handle"})
class FromSourceAsset(
@whitelist_for_serdes(
storage_name="FromSourceAsset", storage_field_names={"node_handle": "solid_handle"}
)
class FromLoadableAsset(
NamedTuple(
"_FromSourceAsset",
"_FromLoadableAsset",
[
("node_handle", NodeHandle),
("input_name", str),
Expand Down
6 changes: 3 additions & 3 deletions python_modules/dagster/dagster/_core/execution/plan/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
FromDirectInputValue,
FromDynamicCollect,
FromInputManager,
FromLoadableAsset,
FromMultipleSources,
FromMultipleSourcesLoadSingleSource,
FromPendingDynamicStepOutput,
FromSourceAsset,
FromStepOutput,
FromUnresolvedStepOutput,
StepInput,
Expand Down Expand Up @@ -441,7 +441,7 @@ def get_step_input_source(
):
# can only load from source asset if assets defs are available
if asset_layer.asset_key_for_input(handle, input_handle.input_name):
return FromSourceAsset(node_handle=handle, input_name=input_name)
return FromLoadableAsset(node_handle=handle, input_name=input_name)
elif input_def.input_manager_key:
return FromInputManager(node_handle=handle, input_name=input_name)

Expand Down Expand Up @@ -626,7 +626,7 @@ def _step_input_source_from_blocking_asset_checks_dep_def(
if source_to_load_from is None:
asset_key_for_input = asset_layer.asset_key_for_input(node_handle, input_handle.input_name)
if asset_key_for_input:
source_to_load_from = FromSourceAsset(node_handle=node_handle, input_name=input_name)
source_to_load_from = FromLoadableAsset(node_handle=node_handle, input_name=input_name)
sources.append(source_to_load_from)
else:
check.failed("Unexpected: no sources to load from and no asset key to load from")
Expand Down

0 comments on commit 2263124

Please sign in to comment.