Skip to content

Commit 6ac5009

Browse files
authored
Fix post commit xlang jdbcio test failure (#35428)
* Temporary get the workaround back for TIMESTAMP field in jdbc. * Trigger the post commit tests.
1 parent ac35062 commit 6ac5009

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"comment": "Modify this file in a trivial way to cause this test suite to run.",
3-
"modification": 13
3+
"modification": 14
44
}
55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"comment": "Modify this file in a trivial way to cause this test suite to run",
3-
"modification": 6
3+
"modification": 7
44
}

sdks/python/apache_beam/io/external/xlang_jdbcio_it_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
from apache_beam.testing.test_pipeline import TestPipeline
3737
from apache_beam.testing.util import assert_that
3838
from apache_beam.testing.util import equal_to
39+
from apache_beam.typehints.schemas import LogicalType
40+
from apache_beam.typehints.schemas import MillisInstant
3941
from apache_beam.utils.timestamp import Timestamp
4042

4143
# pylint: disable=wrong-import-order, wrong-import-position, ungrouped-imports
@@ -239,6 +241,10 @@ def test_xlang_jdbc_write_read(self, database):
239241

240242
config = self.jdbc_configs[database]
241243

244+
# Register MillisInstant logical type to override the mapping from Timestamp
245+
# originally handled by MicrosInstant.
246+
LogicalType.register_logical_type(MillisInstant)
247+
242248
with TestPipeline() as p:
243249
p.not_use_test_runner_api = True
244250
_ = (
@@ -349,6 +355,10 @@ def custom_row_equals(expected, actual):
349355
classpath=config['classpath'],
350356
))
351357

358+
# Register MillisInstant logical type to override the mapping from Timestamp
359+
# originally handled by MicrosInstant.
360+
LogicalType.register_logical_type(MillisInstant)
361+
352362
# Run read pipeline with custom schema
353363
with TestPipeline() as p:
354364
p.not_use_test_runner_api = True

0 commit comments

Comments
 (0)