Lucas
11/17/2025, 3:09 AM@task annotation will hide those parameters from the typechecker. e.g., this code will not throw an error:
@task
def example_task(b: bool):
return False
@flow
def example_flow():
return example_task()
Is this expected behavior? Did I misconfigure something?Nate
11/17/2025, 3:24 PMNate
11/17/2025, 4:06 PMNate
11/17/2025, 4:08 PM__call__ has return_state: bool between *args and **kwargs which breaks ParamSpec . i think was able to reorganize the overloads to preserve type completeness when you don't use return_state, but as this issue mentions, in prefect's next major version we should remove return_state as a kwarg and instead have an explicit method to return the state instead of the resultLucas
11/18/2025, 3:38 AMLucas
11/18/2025, 3:38 AMLucas
11/18/2025, 3:43 AM@task issue typesafe? I would rather not define parallel public/private functions for all tasks, which was my first thoughtNate
11/18/2025, 3:49 AMreturn_state then the overload change i just made should address your type issue. lmk if you checkout the branch and you're seeing something different
for places where there are rather unavoidable type issues (like https://github.com/PrefectHQ/prefect/issues/15008 in the few cases this still exists) then yea its type ignores and private/public encapsulation to minimize type ignores, which is the same thing we do for upstreams that aren't type safeNate
11/18/2025, 3:50 AMLucas
11/18/2025, 3:52 AMNate
11/18/2025, 3:53 AMprefect the SDK which will be tomorrow!Lucas
11/18/2025, 3:53 AMNate
11/18/2025, 3:54 AMuv and see if it fixes your type issue
https://blog.zzstoatzz.io/running-list-of-repros-via-uv/
https://github.com/zzstoatzz/typshtLucas
11/18/2025, 3:54 AMLucas
11/18/2025, 3:55 AMLucas
11/18/2025, 3:55 AMNate
11/18/2025, 10:13 PMLucas
11/18/2025, 11:43 PMNate
11/19/2025, 11:02 PMLucas
11/20/2025, 3:27 AMLucas
11/24/2025, 5:46 AM