-
Notifications
You must be signed in to change notification settings - Fork 133
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
delayed evaluation of annotations causes type mismatches #91
Comments
Nice find. Also want to point out that I really like the Pretty sure the fix is easy but will take a bit of time -- we need to use Happy to take a stab at this. ~~Out of my own curiosity -- are you making use of delayed type annotations much? ~~ Ahh just saw the additional context Also I think this specific case might be slightly easier to fix -- digging in to see if there's a quick change |
OK -- have a quick POC that works with your example. Mind giving the branch a spin? #92. Something like: For productionalizing this I'll add testing with the |
My team mostly uses them for classmethods or builder-pattern type methods that return |
Yes! The code that was previously failing is now running without issue. This behavior was a real adventure to nail down. |
Awesome! Will be getting this out into production shortly -- sorry you had to spend time debugging -- going to be adding some tests to make sure our suite works with the new |
OK, this has been merged and we'll be planning to release. Thanks for finding the bug! #92 |
@gravesee would you mind validating things work with |
Works on 1.19.0rc0 as well! |
Current behavior
importing
annotations
from__future__
causes externally provided nodes to fail type validation.Stack Traces
Screenshots
(If applicable)
Steps to replicate behavior
Library & System Information
python 3.11.1
sf-hamilton==1.18.0
Windows 11
Expected behavior
The above code works without any issues by commenting out the
from __future__ import annotations
line.Additional context
I prefer some type annotation patterns that aren't supported in earlier versions of python. Yet my team needs to target python 3.9+. I imported
annotations
to make use of the nicer type union syntax.The text was updated successfully, but these errors were encountered: