-
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
Mypy 1.11.0 complains about Task typing #14756
Comments
thanks @williamjamir for the issue! will take a look at this |
using this MRE » cat repros/task_typing.py
from functools import partial
from typing import reveal_type
from prefect import task
@task
def test(a: int, b: int) -> None: ...
partial(test, a=1)
reveal_type(test) and this version of » pip freeze | rg mypy
mypy==1.11.0
mypy-extensions==1.0.0 I am not yet able to reproduce this on 2.16.9, newest 2.x, or 3.x specific version checks## 2.16.9
» uv pip install prefect==2.16.9 --force-reinstall
...
» mypy repros/task_typing.py
repros/task_typing.py:12: note: Revealed type is "Any"
Success: no issues found in 1 source file
## newest 2.x
» uv pip install -U prefect
...
» mypy repros/task_typing.py
repros/task_typing.py:12: note: Revealed type is "Any"
Success: no issues found in 1 source file
## newest 3.x
» uv pip install -U prefect --pre
...
» mypy repros/task_typing.py
repros/task_typing.py:12: note: Revealed type is "Any"
Success: no issues found in 1 source file is there anything you notice that I'm missing here? |
Thanks for looking at this @zzstoatzz ! It's odd that mypy is not detecting the correct typing for you. The output of reveal_type is I would expected to see the reveal_type instead as |
taking another look, I was able to reproduce in a completely fresh sandbox environment (root) root@678e57987c9b:~# mypy /tmp/repros/14756.py
/tmp/repros/14756.py:11: error: "Task[[int, int], None]" not callable [misc]
/tmp/repros/14756.py:12: note: Revealed type is "prefect.tasks.Task[[a: builtins.int, b: builtins.int], None]"
Found 1 error in 1 file (checked 1 source file) will dig into this |
it appears that I wasn't able to reproduce before because I had I don't yet understand what perhaps this issue is related? python/mypy#5079 (edit, I dont think it is) edit actually it appears this might be more relevant python/mypy#17585 as without the |
Bug summary
Something has changed from mypy 1.10.1 to 1.11.0 that altered the behavior related to Task typing.
Consider this snippet:
I got the following output on mypy 1.11.0
But I got the following output on mypy 1.10.1
Version info (
prefect version
output)Additional context
No response
The text was updated successfully, but these errors were encountered: