-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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] Refactor component load behavior #27181
[components] Refactor component load behavior #27181
Conversation
977ee0c
to
3c6e30f
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.
Seems reasonable to me
component_file_model=obj, | ||
source_position_tree=parsed.source_position_tree, | ||
) | ||
|
||
def get_component_type(self, registry: ComponentTypeRegistry) -> type[Component]: |
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.
nit: get_
belies that this is doing some real work (parsing python files), maybe resolve_component_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.
might be worth a brief docstr to explain that this does local lookup in addition to the expected registry lookup
b402c39
to
339fe7a
Compare
3c6e30f
to
8e92e27
Compare
Deploy preview for dagster-docs-beta ready! Preview available at https://dagster-docs-beta-1oazby577-elementl.vercel.app Direct link to changed pages: |
8e92e27
to
82497f2
Compare
return MyNestedComponentSchema | ||
|
||
@classmethod | ||
def load(cls, params: MyComponentSchema, context: ComponentLoadContext) -> Self: |
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 type hint for params
should be MyNestedComponentSchema
to match the schema type returned by get_schema()
. This appears to be a copy/paste error from the class above.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
339fe7a
to
145aa32
Compare
5ee4d47
to
fcca097
Compare
fcca097
to
5f00ea4
Compare
Summary & Motivation
This moves the load method onto the individual DeclNode classes, which simplifies the logic a bit and just generally is a bit better organized.
The impetus for this is cleaning up the house a bit in preparation for adding a PythonDeclNode
How I Tested These Changes
Changelog
NOCHANGELOG