-
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
[For 1.2] Allow both protobuf 3 and 4 in dagster #12466
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
3b393f9
to
1f60d2d
Compare
b087711
to
d1e8e6e
Compare
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.
hard for me to forecast what impact narrowing grpcio from 1.32.0 (Sep 9, 2020) to 1.44.0 (Feb 17, 2022) would have. Min version over a year old seems reasonable I think.
@@ -189,12 +189,12 @@ def _streaming_query( | |||
|
|||
def ping(self, echo: str): | |||
check.str_param(echo, "echo") | |||
res = self._query("Ping", api_pb2.PingRequest, echo=echo) | |||
res = self._query("Ping", api_pb2.PingRequest, echo=echo) # type: ignore |
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.
what exactly are the type errors being suppressed here?
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.
bump
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.
See below
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.
brutal - wonder what else we can do to manage this better - maybe our own layer of indirection if the mentioned external libraries are not usable.
I'll definitely feel better about bumping the min grpcio pin if we can get the upper bound removed.. 1.44-1.47 is a bit narrow |
PingRequest = _reflection.GeneratedProtocolMessageType( | ||
"PingRequest", | ||
(_message.Message,), | ||
{ | ||
"DESCRIPTOR": _PINGREQUEST, | ||
"__module__": "api_pb2" | ||
# @@protoc_insertion_point(class_scope:api.PingRequest) | ||
}, | ||
) | ||
_sym_db.RegisterMessage(PingRequest) |
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.
@alangenfeld i think these types were previously explicitly defined and now are generated programatically in some way that pyright can't decipher
We could separately investigate incorporating https://github.com/nipunn1313/mypy-protobuf which apparently works for pyright too, but i had some trouble getting it to work
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.
@alangenfeld ^^ this was the response to your bump
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.
i think these types were previously explicitly defined and now are generated programatically in some way that pyright can't decipher
Yeah you can see all those definitions removed i n the large diff of dagster._grpc.__generated__.api_pb2
.
I'm kind of curious about mypy-protobuf
, I can investigate it later but these ignores look fine for now.
Summary: Making dagster actually install with protobuf4 also requires removing the grpcio pin since that version is pinned to protobuf3 - so we'll need to resolve the upstream issues with hangs/segfaults before we can do this. This PR tests tox suites with both protobuf4 and protobuf3.
"grpcio>=1.44.0,<1.48.1", | ||
"grpcio-health-checking>=1.44.0", |
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.
re - the pins here, one thing i'm not sure about: this new min version is what's needed assuming you want things to keep working if you upgrade to protobuf4, but if you leave the installed protobuf version at 3, you can keep it back at grpcio 1.32.0
i.e. these combos are valid after this PR:
grpcio 1.32.0 / protobuf 3.20.0
grpcio 1.44.0 / protobuf 3.20.0
grpcio 1.44.0 / protobuf 4.22.0
So we could technically leave the >=1.32.0 but that could still result in a combo of libraries that satisfies our constraints but doesn't load correctly
@@ -189,12 +189,12 @@ def _streaming_query( | |||
|
|||
def ping(self, echo: str): | |||
check.str_param(echo, "echo") | |||
res = self._query("Ping", api_pb2.PingRequest, echo=echo) | |||
res = self._query("Ping", api_pb2.PingRequest, echo=echo) # type: ignore |
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.
brutal - wonder what else we can do to manage this better - maybe our own layer of indirection if the mentioned external libraries are not usable.
Summary: This removes the protobuf3 pin in dagster and re-generates our protobuf api with protobuf 4 (which is mostly backwards compatible with protobuf3, see below) Two downsides of this: - we need to bump our min grpcio version to 1.44 since that's the first version that is protobuf3 and protobuf4 compatible, and our min version of protobuf a bit higher. This leaves our grpcio pin fairly narrow until we can get the upper bound removed once they fix the upstream issues. - it nukes our pyright typehints for the generated modules But users have been clamoring for us to remove this protobuf pin so I think it's worth it
Summary:
This removes the protobuf3 pin in dagster and re-generates our protobuf api with protobuf 4 (which is mostly backwards compatible with protobuf3, see below)
Two downsides of this:
But users have been clamoring for us to remove this protobuf pin so I think it's worth it