Skip to content

Commit c537c16

Browse files
authored
Fix jdbc logical type issues when running a yaml pipeline. (#35659)
1 parent 3415378 commit c537c16

File tree

1 file changed

+7
-0
lines changed
  • sdks/python/apache_beam/yaml

1 file changed

+7
-0
lines changed

sdks/python/apache_beam/yaml/main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525

2626
import apache_beam as beam
2727
from apache_beam.io.filesystems import FileSystems
28+
# The following imports force the registration of JDBC logical types.
29+
# When running a Beam YAML pipeline, the expansion service handles JDBCIO using
30+
# Java transforms, bypassing the Python module (`apache_beam.io.jdbc`) that
31+
# registers these types. These imports load the module, preventing a
32+
# "logical type not found" error.
33+
from apache_beam.io.jdbc import JdbcDateType # pylint: disable=unused-import
34+
from apache_beam.io.jdbc import JdbcTimeType # pylint: disable=unused-import
2835
from apache_beam.transforms import resources
2936
from apache_beam.yaml import yaml_testing
3037
from apache_beam.yaml import yaml_transform

0 commit comments

Comments
 (0)