[ 
https://issues.apache.org/jira/browse/BEAM-11838?focusedWorklogId=599497&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-599497
 ]

ASF GitHub Bot logged work on BEAM-11838:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/May/21 22:17
            Start Date: 19/May/21 22:17
    Worklog Time Spent: 10m 
      Work Description: benWize commented on a change in pull request #14829:
URL: https://github.com/apache/beam/pull/14829#discussion_r635620120



##########
File path: sdks/python/apache_beam/io/external/xlang_debeziumio_it_test.py
##########
@@ -0,0 +1,111 @@
+#
+# 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.
+#
+
+import logging
+import unittest
+
+from apache_beam.io.debezium import DriverClassName
+from apache_beam.io.debezium import ReadFromDebezium
+from apache_beam.options.pipeline_options import StandardOptions
+from apache_beam.testing.test_pipeline import TestPipeline
+from apache_beam.testing.util import assert_that
+from apache_beam.testing.util import equal_to
+
+# pylint: disable=wrong-import-order, wrong-import-position, ungrouped-imports
+try:
+  from testcontainers.postgres import PostgresContainer
+except ImportError:
+  PostgresContainer = None
+
+NUM_RECORDS = 1
+
+
[email protected](
+    PostgresContainer is None, 'testcontainers package is not installed')
[email protected](
+    TestPipeline().get_pipeline_options().view_as(StandardOptions).runner is
+    None,
+    'Do not run this test on precommit suites.')
+class CrossLanguageDebeziumIOTest(unittest.TestCase):
+  def setUp(self):
+    self.username = 'debezium'
+    self.password = 'dbz'
+    self.database = 'inventory'
+    self.start_db_container(retries=1)
+    self.host = self.db.get_container_host_ip()
+    self.port = self.db.get_exposed_port(5432)
+    self.connector_class = DriverClassName.POSTGRESQL
+    self.connection_properties = [
+        "database.dbname=inventory",
+        "database.server.name=dbserver1",
+        "database.include.list=inventory",
+        "include.schema.changes=false"
+    ]
+
+  def tearDown(self):
+    # Sometimes stopping the container raises ReadTimeout. We can ignore it
+    # here to avoid the test failure.
+    try:
+      self.db.stop()
+    except:  # pylint: disable=bare-except
+      logging.error('Could not stop the DB container.')
+
+  def test_xlang_debezium_read(self):

Review comment:
       This test is skipped in 
[precommits](https://ci-beam.apache.org/job/beam_PreCommit_Python_Commit/18696/testReport/apache_beam.io.external.xlang_debeziumio_it_test/)
 it is running on portable postcommitIT tests. The other cross-language 
transform tests run in the same way. 




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 599497)
    Time Spent: 6h 10m  (was: 6h)

> An x-lang wrapper for DebeziumIO
> --------------------------------
>
>                 Key: BEAM-11838
>                 URL: https://issues.apache.org/jira/browse/BEAM-11838
>             Project: Beam
>          Issue Type: Bug
>          Components: cross-language, io-java-debezium
>            Reporter: Pablo Estrada
>            Assignee: Benjamin Gonzalez
>            Priority: P2
>              Labels: stale-assigned
>          Time Spent: 6h 10m
>  Remaining Estimate: 0h
>
> DebeziumIO outputs data in JSON format by default, so it's a perfect 
> candidate to be made available as a xlang transform.
> The DebeziumIO module provides a base to implement this, but for an 
> effective, easy-to-use connector in Python, we will need the following things:
>  * A new Java module that includes the per-database dependencies (Debezium's 
> MySQL, Postgres, DB2, Oracle connector dependencies). This is necessary so 
> that users can simply specify a database on the Python side, and the Java 
> side will automatically provide the dependency.
>  * A thorough review of the current default JSON output from DebeziumIO
>  * A set of parameters to be received by the Python wrapper. Maybe we'll use 
> the same format as the existing DebeziumIO (i.e. mandatory parameters: host, 
> user, password; and keyword parameters)
>  
> A short guide: 
> [https://beam.apache.org/documentation/programming-guide/#mulit-language-pipelines]
> An example of this kind of change: [https://github.com/apache/beam/pull/12145]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to