[BEAM-8123] Add cloudpickle as optional library #15472
[BEAM-8123] Add cloudpickle as optional library #15472tvalentyn merged 60 commits intoapache:masterfrom
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.
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.
- how about we use
desired_picklerinstead ofpickle_libto avoid possible confusion due to a typo? - It seems like the condition below should be inverted.
- Let's change the function to:
set_pickle_libto avoid confusion with a usage that inverts a current value without taking desired value into account.
There was a problem hiding this comment.
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 |
| # 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.
needs == instead of = (see Docker suite failure).
There was a problem hiding this comment.
aha. That's why it was failing. Done.
| 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.
Was this an accidental manual change?
There was a problem hiding this comment.
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 <tvalentyn@users.noreply.github.com>
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-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
ValidatesRunnercompliance 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.