-
Notifications
You must be signed in to change notification settings - Fork 34
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: Fixed the compatibility with conda, protobuf 4 and pyext protobuf #471
Conversation
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
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.
Is it possible to add a test that fails? I'm not able to reproduce the issue.
Could you elaborate how this change can fix pyext issue? Essentially, the PR doesn't seem to change the value of exported variables: "repeated_composite_types", "repeated_scalar_types", "map_composite_types". Is it for the case when upb and pyext both exists and the change makes it default to pyext? But pyext is deprecated, if default to pyext, will it raise other issues? |
Let's carefully examine the execution flow. The code does change the items of the lists and the number of those items.
Yes. This is the exact case where you and our customers have issues.
The root cause of this proto-plus bug is that proto-plus does not recognize pyext types when ubp types exist. But conda's protobuf defaults to pyext despite ubp existing.
No. The change does not change the default. It adds the pyext types to the lists.
pyext is used by real customers who want to use Vertex AI. pyext is used by default in protobuf installed by conda. |
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.
Please could you add a comment in the code which explains the reason that we need to include both upb
and pyext
types? You mentioned this in the PR comments but it should be included in code comments as well.
Please could you also fix the failing presubmits ? This PR needs to be updated to cater for #474 which was merged
Otherwise, 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.
Would you be able to refactor the code to reduce duplication? For example, can we use a helper function instead of having repeated code?
try: | ||
from google.protobuf.pyext import _message as _message_pyext | ||
except ImportError: | ||
_message_pyext = None |
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.
Move this import statement to the top of the file since we're importing it as _message_pyext
Fixes: #470
Fixes: googleapis/python-aiplatform#3129