-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix(backend): include prefect-redis as dependency #5907
Conversation
Signed-off-by: Fatih Acar <fatih@opsmill.com>
This is actually the default since 3.1.14. We also need it for Redis messaging support (required for HA). Signed-off-by: Fatih Acar <fatih@opsmill.com>
CodSpeed Performance ReportMerging #5907 will not alter performanceComparing Summary
|
Prefect 3.1.15 introduced a change that breaks mypy with error: Incompatible types in "await" (actual type "State[Coroutine[Any, Any, None]]", expected type "Awaitable[Any]") [misc] Signed-off-by: Fatih Acar <fatih@opsmill.com>
9c79b36
to
9c9bbe3
Compare
Have we checked the latest 3.2 release, ideally this should be our target release. |
Not sure we want to upgrade to Prefect 3.2 at this stage of our release cycle... maybe for our next release? I don't know if there's an issue open upstream, first step would to try the latest 3.2 release to see if its already fixed? |
Looked at this briefly it's the same in 3.2.9.
diff --git a/src/prefect/tasks.py b/src/prefect/tasks.py
index 7763722573..9b291f7a66 100644
--- a/src/prefect/tasks.py
+++ b/src/prefect/tasks.py
@@ -965,7 +965,7 @@ class Task(Generic[P, R]):
def __call__(
self: "Task[P, NoReturn]",
*args: P.args,
- return_state: Literal[False],
+ return_state: Literal[False] = False,
wait_for: Optional[OneOrManyFutureOrResult[Any]] = None,
**kwargs: P.kwargs,
) -> None:
@@ -977,20 +977,22 @@ class Task(Generic[P, R]):
def __call__(
self: "Task[P, R]",
*args: P.args,
- return_state: Literal[True],
- wait_for: Optional[OneOrManyFutureOrResult[Any]] = None,
**kwargs: P.kwargs,
- ) -> State[R]:
+ ) -> R:
...
+ # Keyword parameters `return_state` and `wait_for` aren't allowed after the
+ # ParamSpec `*args` parameter, so we lose return type typing when either of
+ # those are provided.
+ # TODO: Find a way to expose this functionality without losing type information
@overload
def __call__(
self: "Task[P, R]",
*args: P.args,
- return_state: Literal[False],
+ return_state: Literal[True] = True,
wait_for: Optional[OneOrManyFutureOrResult[Any]] = None,
**kwargs: P.kwargs,
- ) -> R:
+ ) -> State[R]:
... As a note if I switch the order of these in Prefect it works as before, but could possibly break stuff for other people. # Keyword parameters `return_state` and `wait_for` aren't allowed after the
# ParamSpec `*args` parameter, so we lose return type typing when either of
# those are provided.
# TODO: Find a way to expose this functionality without losing type information
@overload
def __call__(
self: "Task[P, R]",
*args: P.args,
return_state: Literal[True] = True,
wait_for: Optional[OneOrManyFutureOrResult[Any]] = None,
**kwargs: P.kwargs,
) -> State[R]: ...
@overload
def __call__(
self: "Task[P, R]",
*args: P.args,
return_state: Literal[False] = False,
wait_for: Optional[OneOrManyFutureOrResult[Any]] = None,
**kwargs: P.kwargs,
) -> R: ... I'll open an issue during the day. |
Thanks @ogenstad |
I'd say it depends on when the final release of 1.2 will be cut. I think it would be good with some time to test and validate everything to see if there are any regressions related to this. However looking at the bump in the minor version (https://github.com/PrefectHQ/prefect/releases/tag/3.2.0) it looks like the new features are mostly around the ability to schedule tasks. My guess is that there hasn't been the type of huge changes that would impact us in a negative way. |
I've opened PrefectHQ/prefect#17379 |
This PR adds prefect-redis as dependency.
This is actually the default since 3.1.14.
We also need it for Redis messaging & cache support (required for HA).
Also upgrade to 3.1.15 to include some fixes regarding Redis messaging.
Edit: Prefect 3.1.15 introduced a change that breaks mypy, ignore these errors for now