-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move spec resolution into mapper #22229
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jun 2, 2024
schrockn
force-pushed
the
aget-multi-asset-refactor-7
branch
from
June 2, 2024 20:46
fee4662
to
ce4b8b3
Compare
schrockn
force-pushed
the
aget-multi-asset-refactor-8
branch
from
June 2, 2024 20:46
8f2118d
to
3ea6693
Compare
schrockn
force-pushed
the
aget-multi-asset-refactor-7
branch
from
June 2, 2024 20:53
ce4b8b3
to
58ccf54
Compare
schrockn
force-pushed
the
aget-multi-asset-refactor-8
branch
from
June 2, 2024 20:53
3ea6693
to
82d128a
Compare
schrockn
force-pushed
the
aget-multi-asset-refactor-7
branch
from
June 2, 2024 21:18
58ccf54
to
d045300
Compare
schrockn
force-pushed
the
aget-multi-asset-refactor-8
branch
from
June 2, 2024 21:18
82d128a
to
a5874c1
Compare
schrockn
force-pushed
the
aget-multi-asset-refactor-7
branch
from
June 2, 2024 21:36
d045300
to
f040755
Compare
schrockn
force-pushed
the
aget-multi-asset-refactor-8
branch
from
June 2, 2024 21:36
a5874c1
to
84bc9a8
Compare
schrockn
force-pushed
the
aget-multi-asset-refactor-7
branch
from
June 2, 2024 21:43
f040755
to
9a30fe6
Compare
schrockn
force-pushed
the
aget-multi-asset-refactor-8
branch
from
June 2, 2024 21:44
84bc9a8
to
4a40d8f
Compare
This was referenced Jun 3, 2024
schrockn
force-pushed
the
aget-multi-asset-refactor-7
branch
from
June 3, 2024 10:50
9a30fe6
to
765f08f
Compare
schrockn
force-pushed
the
aget-multi-asset-refactor-8
branch
from
June 3, 2024 10:50
377407b
to
8376f62
Compare
schrockn
commented
Jun 3, 2024
Comment on lines
+357
to
+360
def _spec_resolver(in_out_mapper: "InOutMapper") -> Sequence[AssetSpec]: | ||
resolved_specs = [] | ||
input_deps_by_key = { | ||
key: AssetDep( | ||
asset=key, partition_mapping=in_out_mapper.partition_mappings.get(key) | ||
) | ||
for key in in_out_mapper.asset_keys_by_input_names.values() | ||
} | ||
input_deps = list(input_deps_by_key.values()) | ||
for output_name, asset_out in asset_out_map.items(): | ||
key = in_out_mapper.asset_keys_by_output_name[output_name] | ||
if asset_deps: | ||
deps = [ | ||
input_deps_by_key.get( | ||
dep_key, | ||
AssetDep( | ||
asset=dep_key, | ||
partition_mapping=in_out_mapper.partition_mappings.get(key), | ||
), | ||
) | ||
for dep_key in asset_deps.get(output_name, []) | ||
] | ||
else: | ||
deps = input_deps | ||
|
||
resolved_specs.append(asset_out.to_spec(key, deps=deps)) | ||
return resolved_specs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We move this strange-ish callback into a more standard up the stack.
schrockn
commented
Jun 3, 2024
python_modules/dagster/dagster/_core/definitions/decorators/asset_decorator.py
Outdated
Show resolved
Hide resolved
This was referenced Jun 8, 2024
Closed
Merged
Merged
salazarm
pushed a commit
that referenced
this pull request
Jun 10, 2024
## Summary & Motivation We convert back and forth from non-spec code paths and then reconstruct the specs that *would* have been used to construct the `multi_asset`, which is a bit strange. This moves that logic into the factory machinery. ## How I Tested These Changes BK
This was referenced Jun 10, 2024
danielgafni
pushed a commit
to danielgafni/dagster
that referenced
this pull request
Jun 18, 2024
## Summary & Motivation We convert back and forth from non-spec code paths and then reconstruct the specs that *would* have been used to construct the `multi_asset`, which is a bit strange. This moves that logic into the factory machinery. ## How I Tested These Changes BK
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary & Motivation
We convert back and forth from non-spec code paths and then reconstruct the specs that would have been used to construct the
multi_asset
, which is a bit strange.This moves that logic into the factory machinery.
How I Tested These Changes
BK