-
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
[components] Templating for asset_attributes #26633
[components] Templating for asset_attributes #26633
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
813dc40
to
483060a
Compare
483060a
to
38baab7
Compare
self, | ||
val: Any, | ||
valpath: Optional[Sequence[Union[str, int]]], | ||
should_render: Callable[[Sequence[Union[str, int]]], bool], |
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.
I'm not following this should_render
stuff. Under what conditions will this be true versus false?
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.
I'm still finding this code path quite confusing given what is happening here should be pretty straightforward?
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.
Updated the names in the PR and added some comments, but basically there's just two options for the should_render function:
- a function that always returns true (this is what translators and the like use -- they will greedily render any values they come across)
- a function that inspects the json schema of the target params type to determine if we're deferring or not (this is what we use in the pre-processing stage to keep some fields unrendered)
python_modules/libraries/dagster-components/dagster_components/core/component_rendering.py
Outdated
Show resolved
Hide resolved
38baab7
to
67dc5d0
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.
Req'ing changes based on naming of has_required_scope
67dc5d0
to
3deb344
Compare
3deb344
to
7eb1d13
Compare
python_modules/libraries/dagster-components/dagster_components/core/component_rendering.py
Outdated
Show resolved
Hide resolved
7eb1d13
to
8fb785a
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.
req'ing changes until see the new alternative structure with explicit standalone schema upstack.
8fb785a
to
f4d3125
Compare
f4d3125
to
c4b98aa
Compare
Summary & Motivation
This adds a rendering scope to AssetAttributes, allowing its values to depend on the spec that's currently being evaluated. This is useful for setting properties of a spec based off of other properties (e.g. based off of a tag, set an automation condition)
Refactors component_rendering.py to be more class-based
How I Tested These Changes
Changelog
NOCHANGELOG