diff --git a/.github/trigger_files/beam_PostCommit_Python.json b/.github/trigger_files/beam_PostCommit_Python.json index 62905b12a707..ca5f501f38d9 100644 --- a/.github/trigger_files/beam_PostCommit_Python.json +++ b/.github/trigger_files/beam_PostCommit_Python.json @@ -1,5 +1,5 @@ { "comment": "Modify this file in a trivial way to cause this test suite to run.", - "modification": 13 + "modification": 14 } diff --git a/.github/trigger_files/beam_PostCommit_Python_Xlang_Gcp_Direct.json b/.github/trigger_files/beam_PostCommit_Python_Xlang_Gcp_Direct.json index 455144f02a35..d6a91b7e2e86 100644 --- a/.github/trigger_files/beam_PostCommit_Python_Xlang_Gcp_Direct.json +++ b/.github/trigger_files/beam_PostCommit_Python_Xlang_Gcp_Direct.json @@ -1,4 +1,4 @@ { "comment": "Modify this file in a trivial way to cause this test suite to run", - "modification": 6 + "modification": 7 } diff --git a/sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py b/sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py index 9f90a44d9a00..9ea02d04245b 100644 --- a/sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py +++ b/sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py @@ -36,6 +36,8 @@ from apache_beam.testing.test_pipeline import TestPipeline from apache_beam.testing.util import assert_that from apache_beam.testing.util import equal_to +from apache_beam.typehints.schemas import LogicalType +from apache_beam.typehints.schemas import MillisInstant from apache_beam.utils.timestamp import Timestamp # pylint: disable=wrong-import-order, wrong-import-position, ungrouped-imports @@ -239,6 +241,10 @@ def test_xlang_jdbc_write_read(self, database): config = self.jdbc_configs[database] + # Register MillisInstant logical type to override the mapping from Timestamp + # originally handled by MicrosInstant. + LogicalType.register_logical_type(MillisInstant) + with TestPipeline() as p: p.not_use_test_runner_api = True _ = ( @@ -349,6 +355,10 @@ def custom_row_equals(expected, actual): classpath=config['classpath'], )) + # Register MillisInstant logical type to override the mapping from Timestamp + # originally handled by MicrosInstant. + LogicalType.register_logical_type(MillisInstant) + # Run read pipeline with custom schema with TestPipeline() as p: p.not_use_test_runner_api = True