-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
check api compatibility when entering a client context #15252
Conversation
CodSpeed Performance ReportMerging #15252 will not alter performanceComparing Summary
|
src/prefect/context.py
Outdated
@@ -210,6 +210,7 @@ def __enter__(self): | |||
self._context_stack += 1 | |||
if self._context_stack == 1: | |||
self.client.__enter__() | |||
self.client.api_compatible() |
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.
This and below seemed like the best place to put this so that it only called once
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.
one request on method name change, otherwise this LGTM!
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.
lgtm!
When entering a
SyncClientContext
orAsyncClientContext
for the first time, check if the client and server are compatible.This PR defines compatibility as both the client and server must be on the same major version. The goal of this pr is specifically to flag incompatibility between
2.x
and3.x
clients and servers (in both directions). I'm very open to changing this in anyway that makes it more useful and future proof for the direction of the package.