-
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
[external-assets] Make execution_type an ExternalAssetNode property #19684
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @smackesey and the rest of your teammates on Graphite |
9d22a35
to
d881aa6
Compare
a5a00c6
to
1a4ff9b
Compare
d881aa6
to
a1490ca
Compare
1a4ff9b
to
cfd2894
Compare
a1490ca
to
36d76b2
Compare
cfd2894
to
acd306f
Compare
36d76b2
to
be3a82e
Compare
acd306f
to
69d7b3e
Compare
be3a82e
to
33f844e
Compare
69d7b3e
to
b507aba
Compare
33f844e
to
3268b72
Compare
b507aba
to
da4cd8d
Compare
3268b72
to
b6eb4c3
Compare
da4cd8d
to
a956af4
Compare
b6eb4c3
to
58c9a32
Compare
a956af4
to
5cceb48
Compare
58c9a32
to
0e3c817
Compare
5cceb48
to
71ef97e
Compare
71ef97e
to
046bc7f
Compare
046bc7f
to
46799c0
Compare
461f3a7
to
74a61c6
Compare
74a61c6
to
078c860
Compare
078c860
to
f035484
Compare
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.
Can we please do this without changing the public API for asset
and multi_asset
and friends? The _
prefixed arguments will pollute typeaheads, we'll need documentation, it will add confusion etc.
bee736f
to
0ed5804
Compare
0ed5804
to
05f5a4c
Compare
) | ||
or AssetExecutionType.MATERIALIZATION | ||
) | ||
|
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.
Even though we are sticking with metadata for now to specify AssetExecutionType
on AssetsDefinition
, We still need this check because when an ExternalAssetNode
represents a source asset there is no such metadata.
I tried to do this by directly constructing For the time being I reverted to using metadata per your suggestion in the upstack PR. This PR does still add the property on |
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.
Great
val = metadata[SYSTEM_METADATA_KEY_ASSET_EXECUTION_TYPE] | ||
if not isinstance(val, TextMetadataValue): | ||
check.failed( | ||
f"Expected metadata value for key {SYSTEM_METADATA_KEY_ASSET_EXECUTION_TYPE} to be a TextMetadataValue, got {val}" | ||
) | ||
metadata_execution_type = AssetExecutionType.str_to_enum(val.value) | ||
if execution_type is not None: | ||
check.invariant( | ||
execution_type == metadata_execution_type, | ||
f"Execution type {execution_type} in metadata does not match type inferred from metadata {metadata_execution_type}", | ||
) | ||
execution_type = metadata_execution_type |
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.
consider extracting out body of if
into the helper function to compartmentalize the backward compat code
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.
the reason I didn't are that there are subsequent commented backcompat blocks in the constructor, so it was more consistent to go inline
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.
cool makes sense.
…19684) ## Summary & Motivation This adds `execution_type` as a property on `ExternalAssetsNode` and defines execution-type related helper properties on `AssetsDefinition`. Logic is in place on `ExternalAssetNode` to ensure that `execution_type` specified as a param agrees with metadata. ## How I Tested These Changes Existing test suite.
Summary & Motivation
This adds
execution_type
as a property onExternalAssetsNode
and defines execution-type related helper properties onAssetsDefinition
.Logic is in place on
ExternalAssetNode
to ensure thatexecution_type
specified as a param agrees with metadata.How I Tested These Changes
Existing test suite.