diff --git a/.github/trigger_files/beam_PostCommit_Python_Xlang_Gcp_Dataflow.json b/.github/trigger_files/beam_PostCommit_Python_Xlang_Gcp_Dataflow.json index afdc7f7012a8..2504db607e46 100644 --- a/.github/trigger_files/beam_PostCommit_Python_Xlang_Gcp_Dataflow.json +++ b/.github/trigger_files/beam_PostCommit_Python_Xlang_Gcp_Dataflow.json @@ -1,4 +1,4 @@ { "comment": "Modify this file in a trivial way to cause this test suite to run", - "modification": 11 + "modification": 12 } 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 d6a91b7e2e86..38ae1cf68222 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": 7 + "modification": 8 } 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 9ea02d04245b..094161afbf93 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 @@ -121,7 +121,8 @@ class CrossLanguageJdbcIOTest(unittest.TestCase): 'postgresql', 'org.postgresql.Driver'), 'mysql': DbData( - lambda: MySqlContainer(), ['mysql:mysql-connector-java:8.0.28'], + lambda: MySqlContainer(dialect='pymysql'), + ['mysql:mysql-connector-java:8.0.28'], 'mysql', 'com.mysql.cj.jdbc.Driver') } @@ -143,13 +144,13 @@ def setUpClass(cls): 'username': 'test', 'password': 'test', 'host': container.get_container_host_ip(), - 'port': container.get_exposed_port(container.port_to_expose), + 'port': container.get_exposed_port(container.port), 'database_name': 'test', 'driver_class_name': db_data.connector, 'classpath': db_data.classpath, 'jdbc_url': ( f'jdbc:{db_data.db_string}://{container.get_container_host_ip()}:' - f'{container.get_exposed_port(container.port_to_expose)}/test'), + f'{container.get_exposed_port(container.port)}/test'), 'binary_type': POSTGRES_BINARY_TYPE if db_type == 'postgres' else MYSQL_BINARY_TYPE } diff --git a/sdks/python/apache_beam/yaml/integration_tests.py b/sdks/python/apache_beam/yaml/integration_tests.py index 9a1c4478a587..6477ccffd000 100644 --- a/sdks/python/apache_beam/yaml/integration_tests.py +++ b/sdks/python/apache_beam/yaml/integration_tests.py @@ -78,7 +78,7 @@ def gcs_temp_dir(bucket): @contextlib.contextmanager def temp_spanner_table(project, prefix='temp_spanner_db_'): - """Context manager to create and clean up a temporary Spanner database and + """Context manager to create and clean up a temporary Spanner database and table. Creates a unique temporary Spanner database within the specified project @@ -94,7 +94,7 @@ def temp_spanner_table(project, prefix='temp_spanner_db_'): Yields: list[str]: A list containing connection details: [project_id, instance_id, database_id, table_name, list_of_columns]. - Example: ['my-project', 'beam-test', 'temp_spanner_db_...', 'tmp_table', + Example: ['my-project', 'beam-test', 'temp_spanner_db_...', 'tmp_table', ['UserId', 'Key']] """ spanner_client = SpannerWrapper(project) @@ -152,7 +152,7 @@ def temp_sqlite_database(prefix='yaml_jdbc_it_'): This function creates a temporary SQLite database file on the local filesystem. It establishes a connection using 'sqlite3', creates a predefined 'tmp_table', and then yields a JDBC connection string suitable for use in - tests that require a generic JDBC connection (specifically configured for + tests that require a generic JDBC connection (specifically configured for SQLite in this case). The SQLite database file is automatically cleaned up (closed and deleted) @@ -228,7 +228,7 @@ def temp_mysql_database(): with the MySQL database during setup. Exception: Any other exception encountered during the setup process. """ - with MySqlContainer(init=True) as mysql_container: + with MySqlContainer(init=True, dialect='pymysql') as mysql_container: try: # Make connection to temp database and create tmp table engine = sqlalchemy.create_engine(mysql_container.get_connection_url()) @@ -240,7 +240,7 @@ def temp_mysql_database(): # Construct the JDBC url for connections later on by tests jdbc_url = ( f"jdbc:mysql://{mysql_container.get_container_host_ip()}:" - f"{mysql_container.get_exposed_port(mysql_container.port_to_expose)}/" + f"{mysql_container.get_exposed_port(mysql_container.port)}/" f"{mysql_container.MYSQL_DATABASE}?" f"user={mysql_container.MYSQL_USER}&" f"password={mysql_container.MYSQL_PASSWORD}") @@ -362,9 +362,9 @@ def temp_sqlserver_database(): class OracleTestContainer(DockerContainer): """ OracleTestContainer is an updated version of OracleDBContainer that goes - ahead and sets the oracle password, waits for logs to establish that the + ahead and sets the oracle password, waits for logs to establish that the container is ready before calling get_exposed_port, and uses a more modern - oracle driver. + oracle driver. """ def __init__(self): super().__init__("gvenzl/oracle-xe:21-slim")