-
-
Notifications
You must be signed in to change notification settings - Fork 721
✨ Allow annotated parsing with a subclass of Path
#1183
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
base: master
Are you sure you want to change the base?
Conversation
Path
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.
Hi, thanks for the contribution and feature request!
What you're proposing makes sense to me, and at a first glance the code looks good. Surprisingly, some of the CI tests do fail. Do you have time to look into those?
Well - that was a rabbit hole. |
7a8257c
to
ae9ddd5
Compare
@svlandeg what happens now? |
f367808
to
4d78ba6
Compare
Thank you for the update - I have monkey patched my applications for now. |
4d78ba6
to
40c6e1e
Compare
Please allow using custom Path subclasses such as UPath
Here is an example
But as you can see in my debugger, the parsed value will get converted to a Path by the param_path_convertor.
Allowing that function to return anything that is already a Path (or maybe a PurePath?) would fix this issue, though, it maybe a problem for other types as well?
I can hack around this by setting the annotated type to None but using UPath as a parser, however that does not seem to be documented behavior or good practice.