Skip to content
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

Enable cloudpickle default #34223

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/trigger_files/beam_PostCommit_Python.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"comment": "Modify this file in a trivial way to cause this test suite to run.",
"https://github.com/apache/beam/pull/32440": "test new datastream runner for batch"
<<<<<<< HEAD
"modification": 9
=======
"modification": 10
>>>>>>> Trigger postcommits.
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"comment": "Modify this file in a trivial way to cause this test suite to run",
"modification": 2
"modification": 3
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"comment": "Modify this file in a trivial way to cause this test suite to run",
<<<<<<< HEAD
"modification": 10
=======
"modification": 12
>>>>>>> Trigger postcommits.
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"comment": "Modify this file in a trivial way to cause this test suite to run",
"modification": 5
"modification": 6
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"comment": "Modify this file in a trivial way to cause this test suite to run",
"modification": 3
"modification": 4
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"comment": "Modify this file in a trivial way to cause this test suite to run",
"modification": 1
"modification": 2
}
5 changes: 3 additions & 2 deletions sdks/python/apache_beam/internal/pickler.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

USE_CLOUDPICKLE = 'cloudpickle'
USE_DILL = 'dill'
DEFAULT_PICKLE_LIB = USE_DILL
DEFAULT_PICKLE_LIB = USE_CLOUDPICKLE

desired_pickle_lib = dill_pickler
desired_pickle_lib = cloudpickle_pickler


def dumps(o, enable_trace=True, use_zlib=False) -> bytes:
Expand Down Expand Up @@ -66,6 +66,7 @@ def load_session(file_path):

def set_library(selected_library=DEFAULT_PICKLE_LIB):
""" Sets pickle library that will be used. """
selected_library = USE_CLOUDPICKLE
global desired_pickle_lib
# If switching to or from dill, update the pickler hook overrides.
if (selected_library == USE_DILL) != (desired_pickle_lib == dill_pickler):
Expand Down
2 changes: 1 addition & 1 deletion sdks/python/apache_beam/pipeline_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def test_auto_unique_labels(self):

opts = PipelineOptions(["--auto_unique_labels"])
with mock.patch.object(uuid, 'uuid4') as mock_uuid_gen:
mock_uuids = [mock.Mock(hex='UUID01XXX'), mock.Mock(hex='UUID02XXX')]
mock_uuids = [mock.Mock(hex=f'UUID0{i}XXX') for i in range(1, 20)]
mock_uuid_gen.side_effect = mock_uuids
with TestPipeline(options=opts) as pipeline:
pcoll = pipeline | 'pcoll' >> Create([1, 2, 3])
Expand Down
Loading