-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update gen_protos to work with new protobuf on os-x. #25914
Conversation
R: @AnandInguva |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control |
The failures in apache_beam.runners.interactive.sql.utils_test.OptionsFormTest.test_dataflow_options_form look irrelevant. |
Run Python_Runners PreCommit |
Run Python_Coverage PreCommit |
Apparently the c-compiled protos are no longer available by default.
Run Python_Runners PreCommit |
Run Python_Coverage PreCommit |
_message.RepeatedCompositeContainer, | ||
) # pylint: disable=c-extension-no-member | ||
except ImportError: | ||
from google.protobuf.internal import containers |
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.
could you add a comment in which cases you expect else branch be used?
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.
Yes, that would be helpful. I haven't caught this error while i was using when PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=upb
(which is default).
but when PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION==python
(slow implementation of protobufs which we don't want to use) I was using except
case.
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've refactored this to be more explicit. Apparently the default implementation depends on the platform (and what wheels are shipped for it). Fast protos shouldn't matter here, and we are (as we should) verifying that we have a compiled implementation in our containers.
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.
asked someone to look into broken build.
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.
PTAL
_message.RepeatedCompositeContainer, | ||
) # pylint: disable=c-extension-no-member | ||
except ImportError: | ||
from google.protobuf.internal import containers |
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've refactored this to be more explicit. Apparently the default implementation depends on the platform (and what wheels are shipped for it). Fast protos shouldn't matter here, and we are (as we should) verifying that we have a compiled implementation in our containers.
Backend: Wrote response {'code': 1, 'exc_type': 'AttributeError', 'exc_msg': "module 'google._upb.message' has no attribute 'RepeatedScalarFieldContainer'"} to /tmp/pep517_get_requires_for_build_sdist-xkfitq5.json |
Would it be a problem if different implementations were used at pipeline submission vs runtime? Is this a scenario we may be facing (for example when one submits a pipeline from MacOS which presumably doesn't have the right wheels)? |
sdks/python/gen_protos.py
Outdated
"Unknown proto implementation: " + api_implementation.Type()) | ||
repeated_types = ( | ||
list, | ||
impl.RepeatedScalarFieldContainer, |
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.
RepeatedScalarContainer
should be used when it is google.protobuf.pyext._message
or google._upb import _message
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.
Oh, good point. Fixed.
Regarding different implementations at compile vs. runtime, this is fine, as this code is just to do proto introspection to auto-generate the urn files to make type checkers more robust. |
Codecov Report
@@ Coverage Diff @@
## master #25914 +/- ##
==========================================
- Coverage 71.41% 71.41% -0.01%
==========================================
Files 778 778
Lines 102379 102435 +56
==========================================
+ Hits 73112 73149 +37
- Misses 27811 27830 +19
Partials 1456 1456
Flags with carried forward coverage won't be shown. Click here to find out more. see 9 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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. seems like there is a lint error.
yes, I understand this code is not relevant for job submission. My question is whether we should anticipate issues for some users of Mac OS b/c they will be using a different protobuf implementation. |
Ah. I hope not; the various implementations (or at least their public APIs)
should be drop in replacements for each other. It's possible local runner
performance may suffer, but probably not by that much, and it was never
targeted at high efficiency anyway.
…On Thu, Mar 23, 2023 at 10:53 AM tvalentyn ***@***.***> wrote:
yes, I understand this code is not relevant for job submission. My
question is whether we should anticipate issues for some users of Mac OS
b/c they will be using a different protobuf implementation.
—
Reply to this email directly, view it on GitHub
<#25914 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADWVAM7UBASMZNWPRC5MA3W5SEYBANCNFSM6AAAAAAWCUPNJA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Apparently the c-compiled protos are no longer available by default.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.