Skip to content

Commit 1e2b71f

Browse files
iindyktfx-copybara
authored andcommitted
Fixes pickling error in saved_transform_io_v2.py with Python 3.11.
PiperOrigin-RevId: 610903193
1 parent 8138c6a commit 1e2b71f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tensorflow_transform/py_func/pyfunc_helper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import dill
1717
import tensorflow as tf
18+
from tfx_bsl import beam as tfx_bsl_beam
1819
# TODO(b/243513856): Switch to `collections.namedtuple` or `typing.NamedTuple`
1920
# once the Spark issue is resolved.
2021
from tfx_bsl.types import tfx_namedtuple
@@ -26,6 +27,8 @@
2627

2728
_PYFUNC_COLLECTION_KEY = 'pyfuncs'
2829

30+
tfx_bsl_beam.fix_code_type_pickling()
31+
2932

3033
class _PyFuncDef(tfx_namedtuple.namedtuple('_PyFuncDef', ['token', 'func'])):
3134
"""An internal wrapper around tuple(token, func).

0 commit comments

Comments
 (0)