-
Notifications
You must be signed in to change notification settings - Fork 2
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
Better handling of typing.Optional
#50
Conversation
def require_union(x: Union[int, float]) -> str: | ||
return f'{x}' | ||
|
||
pipeline = sl.Pipeline([require_union]) |
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 you add a provider for int
and/or float
so this actually tests something?
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.
Good point, see update!
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.
Please add tests where there is an optional and a required dependency on some value. And check that it works for any order or providers and whether the value can be provided or not.
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 added one test, not entirely sure what the other cases you are asking for are.
Fixes #40.
Should we add top-level docs for this?