-
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
base: master
Are you sure you want to change the base?
[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?
return self._resolve(val, [], should_render=should_render) | ||
|
||
|
||
def has_required_scope( |
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 think part of my confusion is that this function name is a bit ambigious. Does it mean that there is a field that has the RenderingScope
attribute?
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.
Does it mean that there is a field that has the RenderingScope attribute?
That's right yeah -- basically should_render is a function that reads the json schema and determines if anything along the path has some required scope
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.
has_rendering_scope
?
38baab7
to
67dc5d0
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