Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 14 additions & 19 deletions sdks/python/apache_beam/yaml/integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from datetime import timezone

import mock
import mysql.connector
import psycopg2
import pytds
import sqlalchemy
Expand Down Expand Up @@ -286,26 +285,22 @@ def temp_mysql_database():
Exception: Any other exception encountered during the setup process.
"""
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())
with engine.begin() as connection:
connection.execute(
sqlalchemy.text(
"CREATE TABLE tmp_table (value INTEGER, `rank` INTEGER);"))
# Make connection to temp database and create tmp table
engine = sqlalchemy.create_engine(mysql_container.get_connection_url())
with engine.begin() as connection:
connection.execute(
sqlalchemy.text(
"CREATE TABLE tmp_table (value INTEGER, `rank` INTEGER);"))

# 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)}/"
f"{mysql_container.dbname}?"
f"user={mysql_container.username}&"
f"password={mysql_container.password}")
# 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)}/"
f"{mysql_container.dbname}?"
f"user={mysql_container.username}&"
f"password={mysql_container.password}")

yield jdbc_url
except mysql.connector.Error as err:
logging.error("Error interacting with temporary MySQL DB: %s", err)
raise err
yield jdbc_url


@contextlib.contextmanager
Expand Down
1 change: 0 additions & 1 deletion sdks/python/container/ml/py310/base_image_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ mock==5.2.0
more-itertools==10.7.0
mpmath==1.3.0
multidict==6.6.4
mysql-connector-python==9.4.0
namex==0.1.0
networkx==3.4.2
nltk==3.9.1
Expand Down
1 change: 0 additions & 1 deletion sdks/python/container/ml/py311/base_image_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ mock==5.2.0
more-itertools==10.7.0
mpmath==1.3.0
multidict==6.6.4
mysql-connector-python==9.4.0
namex==0.1.0
networkx==3.5
nltk==3.9.1
Expand Down
1 change: 0 additions & 1 deletion sdks/python/container/ml/py312/base_image_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ mock==5.2.0
more-itertools==10.7.0
mpmath==1.3.0
multidict==6.6.4
mysql-connector-python==9.4.0
namex==0.1.0
networkx==3.5
nltk==3.9.1
Expand Down
1 change: 0 additions & 1 deletion sdks/python/container/ml/py39/base_image_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ mock==5.2.0
more-itertools==10.7.0
mpmath==1.3.0
multidict==6.6.4
mysql-connector-python==9.4.0
namex==0.1.0
networkx==3.2.1
nltk==3.9.1
Expand Down
1 change: 0 additions & 1 deletion sdks/python/container/py310/base_image_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ mmh3==5.2.0
mock==5.2.0
more-itertools==10.7.0
multidict==6.6.4
mysql-connector-python==9.4.0
nltk==3.9.1
numpy==2.2.6
oauth2client==4.1.3
Expand Down
1 change: 0 additions & 1 deletion sdks/python/container/py311/base_image_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ mmh3==5.2.0
mock==5.2.0
more-itertools==10.7.0
multidict==6.6.4
mysql-connector-python==9.4.0
nltk==3.9.1
numpy==2.2.6
oauth2client==4.1.3
Expand Down
1 change: 0 additions & 1 deletion sdks/python/container/py312/base_image_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ mmh3==5.2.0
mock==5.2.0
more-itertools==10.7.0
multidict==6.6.4
mysql-connector-python==9.4.0
nltk==3.9.1
numpy==2.2.6
oauth2client==4.1.3
Expand Down
1 change: 0 additions & 1 deletion sdks/python/container/py313/base_image_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ mmh3==5.2.0
mock==5.2.0
more-itertools==10.7.0
multidict==6.6.4
mysql-connector-python==9.4.0
nltk==3.9.1
numpy==2.2.6
oauth2client==4.1.3
Expand Down
1 change: 0 additions & 1 deletion sdks/python/container/py39/base_image_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ mmh3==5.2.0
mock==5.2.0
more-itertools==10.7.0
multidict==6.6.4
mysql-connector-python==9.4.0
nltk==3.9.1
numpy==2.0.2
oauth2client==4.1.3
Expand Down
1 change: 0 additions & 1 deletion sdks/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ def get_portability_package_data():
'cryptography>=41.0.2',
'hypothesis>5.0.0,<7.0.0',
'virtualenv-clone>=0.5,<1.0',
'mysql-connector-python>=9.3.0',
'python-tds>=1.16.1',
'sqlalchemy-pytds>=1.0.2',
'pg8000>=1.31.1',
Expand Down
Loading