Skip to content

Commit 44fa58e

Browse files
committed
Use relative filepaths for deterministic coder pickling.
1 parent 7317cec commit 44fa58e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

sdks/python/apache_beam/coders/coder_impl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ def encode_type(self, t, stream):
561561

562562
if t not in _pickled_types:
563563
_pickled_types[t] = cloudpickle_pickler.dumps(
564-
t, config=cloudpickle_pickler.NO_DYNAMIC_CLASS_TRACKING_CONFIG)
564+
t, config=cloudpickle_pickler.DETERMINISTIC_CODER_CONFIG)
565565
stream.write(_pickled_types[t], True)
566566

567567
def decode_type(self, stream):

sdks/python/apache_beam/internal/cloudpickle_pickler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@
3939

4040
DEFAULT_CONFIG = cloudpickle.CloudPickleConfig(
4141
skip_reset_dynamic_type_state=True)
42-
NO_DYNAMIC_CLASS_TRACKING_CONFIG = cloudpickle.CloudPickleConfig(
43-
id_generator=None, skip_reset_dynamic_type_state=True)
42+
DETERMINISTIC_CODER_CONFIG = cloudpickle.CloudPickleConfig(
43+
id_generator=None,
44+
skip_reset_dynamic_type_state=True,
45+
use_relative_filepaths=True)
4446

4547
try:
4648
from absl import flags

0 commit comments

Comments
 (0)