-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add component argument inference #763
Conversation
Pipeline failure is unrelated. Submitted #764 to fix it. |
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.
Thanks Robbe! Nice work, the tests are quite extensive and seem to cover all scenarios
BUILTIN_TYPES = [str, int, float, bool, dict, list] | ||
|
||
|
||
def annotation_to_type(annotation: t.Any) -> t.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.
Nice !
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.
😍
Follow-up to use the argument inference functionality added in #763
Fixes #751
This PR introduces functionality to infer the arguments from a
Component
class. The result is a dictionary with the argument names as keys, andArgument
instances as values, which is the format ofcomponent_spec.args
.We can leverage this behavior for Lightweight Python components as described in #750.
Did some TDD here, let me know if I missed any cases.