Skip to content
Closed
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
6 changes: 5 additions & 1 deletion sdks/python/apache_beam/internal/cloudpickle_pickler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import base64
import bz2
import dataclasses
import io
import logging
import sys
Expand Down Expand Up @@ -187,7 +188,10 @@ def _dumps(
with _pickle_lock:
with io.BytesIO() as file:
if enable_stable_code_identifier_pickling:
config = STABLE_CODE_IDENTIFIER_CONFIG
config = dataclasses.replace(
config,
get_code_object_params=STABLE_CODE_IDENTIFIER_CONFIG.
get_code_object_params)
pickler = cloudpickle.CloudPickler(file, config=config)
try:
pickler.dispatch_table[type(flags.FLAGS)] = _pickle_absl_flags
Expand Down
2 changes: 2 additions & 0 deletions sdks/python/apache_beam/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,8 @@ def to_runner_api(
# because other runners do not have this option.
context.enable_best_effort_deterministic_pickling = getattr(
self.runner, 'enable_best_effort_deterministic_pickling', False)
context.enable_stable_identifier_pickling = getattr(
self.runner, 'enable_stable_code_identifier_pickling', False)

# The RunnerAPI spec requires certain transforms and side-inputs to have KV
# inputs (and corresponding outputs).
Expand Down
Loading