claudevdm commented on code in PR #36617:
URL: https://github.com/apache/beam/pull/36617#discussion_r2466232915
##########
sdks/python/apache_beam/internal/cloudpickle_pickler.py:
##########
@@ -156,17 +156,24 @@ def _dumps(
enable_stable_code_identifier_pickling=False,
config: cloudpickle.CloudPickleConfig = DEFAULT_CONFIG) -> bytes:
+ if enable_stable_code_identifier_pickling:
Review Comment:
I'm a bit confused about the difference between these options.
Is enable_best_effort_determinism meant to include the stable identifier
change too? Or is that not part of best effort determinisn?
##########
sdks/python/apache_beam/internal/test_data/module_for_path_test.py:
##########
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""A test module for source file path normalization."""
+
+
+def func_for_path_test():
Review Comment:
Can you define this in cloudpickle_pickler_test instead of creating a new
file?
##########
sdks/python/apache_beam/internal/cloudpickle_pickler.py:
##########
@@ -156,17 +156,24 @@ def _dumps(
enable_stable_code_identifier_pickling=False,
config: cloudpickle.CloudPickleConfig = DEFAULT_CONFIG) -> bytes:
+ if enable_stable_code_identifier_pickling:
+ config = STABLE_CODE_IDENTIFIER_CONFIG
+ config_kwargs = config.__dict__.copy()
+
if enable_best_effort_determinism:
# TODO: Add support once https://github.com/cloudpipe/cloudpickle/pull/563
# is merged in.
- _LOGGER.warning(
- 'Ignoring unsupported option: enable_best_effort_determinism. '
- 'This has only been implemented for dill.')
+ config_kwargs['filepath_interceptor'] = cloudpickle.get_relative_path
Review Comment:
Can we rather explicitly define a BEST_EFFORT_DETERMINISM config at the top
of this file and use that? Its easier to see exact settings
BEST_EFFORT_DETERMINISM requires and no copying configs required
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]