-
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
[BEAM-8123] Add cloudpickle as optional library #15472
Conversation
R: @tvalentyn |
Python Unit Tests |
Python Unit Tests |
Python Unit Tests |
Python Unit Tests |
loads(dumps(module_test.TopClass.MiddleClass.NestedClass('abc'))).datum) | ||
|
||
def test_dynamic_class(self): | ||
"""Tests that a nested class object is pickled correctly.""" |
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.
nit: duplicated comment?
You could also name the test so that it captures the behavior; then the comment becomes unnecessary. E.g. smth like:
test_pickling_preserves_closure_of_a_function()
test_dynamic_class_objects_pickle_correctly()
|
||
def change_pickle_lib(pickle_lib): | ||
""" Changes pickling library. Users should prefer the default library.""" | ||
global pickler_lib |
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.
- how about we use
desired_pickler
instead ofpickle_lib
to avoid possible confusion due to a typo? - It seems like the condition below should be inverted.
- Let's change the function to:
set_pickle_lib
to avoid confusion with a usage that inverts a current value without taking desired value into account.
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 I like these suggestions.
I think Run Unit Tests is not a valid trigger command, tests run by themselves when you push new changes. Github action tests don't have trigger commands, but could be re-triggered by via a UI. Jenkins suites have trigger commands listed in quotes and also in https://github.com/apache/beam/blob/master/.test-infra/jenkins/README.md . There is also "retestt this please" command that reruns all Jenkins suites (typo intentional to avoid actual re-test as I type this). |
Looks like there are a few errors in the suites:
For this one, you need to add a dependency on |
@@ -26,6 +26,7 @@ | |||
# TODO(AVRO-2429): Upgrade to >= 1.9.0 only after resolved | |||
avro-python3==1.8.2 | |||
fastavro==1.0.0.post1 | |||
cloudpickle=2.0.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.
needs == instead of = (see Docker suite failure).
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.
aha. That's why it was failing. Done.
@@ -68,7 +69,7 @@ google-cloud-videointelligence==1.16.1 | |||
google-cloud-vision==1.0.0 | |||
google-crc32c==1.3.0 | |||
google-pasta==0.2.0 | |||
google-python-cloud-debugger==2.18 | |||
google-python-cloud-debugger==2.8 |
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.
Was this an accidental manual change?
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.
yeah there is something weird going on here. I've manually changed this PR to only add cloudpickle. It shouldn't be doing anything else.
added valentines suggestions. Co-authored-by: tvalentyn <[email protected]>
Wraps the pickle library so that users can choose either cloudpickle or dill.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
ValidatesRunner
compliance status (on master branch)Examples testing status on various runners
Post-Commit SDK/Transform Integration Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.