From 300f5ad520ac54f3c34b64f6941514208c53e669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=80=D1=82=D1=8B=D0=BD=D0=BE=D0=B2=20=D0=9C?= =?UTF-8?q?=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A1=D0=B5=D1=80=D0=B3=D0=B5?= =?UTF-8?q?=D0=B5=D0=B2=D0=B8=D1=87?= Date: Thu, 23 May 2024 15:21:51 +0000 Subject: [PATCH] [DOP-13851] Update MySQL package to 8.4.0 --- .github/workflows/data/mysql/matrix.yml | 4 ++-- docs/changelog/next_release/253.feature.rst | 2 +- docs/connection/db_connection/mysql/prerequisites.rst | 2 +- onetl/connection/db_connection/mysql/connection.py | 10 +++++----- .../tests_db_connection_unit/test_mysql_unit.py | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/data/mysql/matrix.yml b/.github/workflows/data/mysql/matrix.yml index cd96a63b9..8e46b42e8 100644 --- a/.github/workflows/data/mysql/matrix.yml +++ b/.github/workflows/data/mysql/matrix.yml @@ -21,14 +21,14 @@ latest: &latest matrix: small: - - mysql-version: 8.3.0 + - mysql-version: 8.4.0 <<: *max full: # Min supported version by JDBC driver is 5.7 - mysql-version: 5.7.6 <<: *min # Max supported version by JDBC driver is 8.3 - - mysql-version: 8.3.0 + - mysql-version: 8.4.0 <<: *max nightly: - mysql-version: 5.7.6 diff --git a/docs/changelog/next_release/253.feature.rst b/docs/changelog/next_release/253.feature.rst index 46b364d95..92994bdbb 100644 --- a/docs/changelog/next_release/253.feature.rst +++ b/docs/changelog/next_release/253.feature.rst @@ -1 +1 @@ -:class:`MySQL` connection now uses MySQL JDBC driver ``8.3.0``, upgraded from ``8.0.33``, and supports passing custom versions: ``MySQL.get_packages(package_version=...)``. +:class:`MySQL` connection now uses MySQL JDBC driver ``8.4.0``, upgraded from ``8.0.33``, and supports passing custom versions: ``MySQL.get_packages(package_version=...)``. diff --git a/docs/connection/db_connection/mysql/prerequisites.rst b/docs/connection/db_connection/mysql/prerequisites.rst index 99b7820cb..225e630b2 100644 --- a/docs/connection/db_connection/mysql/prerequisites.rst +++ b/docs/connection/db_connection/mysql/prerequisites.rst @@ -6,7 +6,7 @@ Prerequisites Version Compatibility --------------------- -* MySQL server versions: 5.7, 8.0 +* MySQL server versions: 5.7 - 8.4 * Spark versions: 2.3.x - 3.5.x * Java versions: 8 - 20 diff --git a/onetl/connection/db_connection/mysql/connection.py b/onetl/connection/db_connection/mysql/connection.py index 6774870b9..a80bd7ac9 100644 --- a/onetl/connection/db_connection/mysql/connection.py +++ b/onetl/connection/db_connection/mysql/connection.py @@ -34,8 +34,8 @@ class Config: class MySQL(JDBCConnection): """MySQL JDBC connection. |support_hooks| - Based on Maven package ``com.mysql:mysql-connector-j:8.0.33`` - (`official MySQL JDBC driver `_). + Based on Maven package `com.mysql:mysql-connector-j:8.4.0 `_ + (`official MySQL JDBC driver `_). .. warning:: @@ -125,7 +125,7 @@ def get_packages(cls, package_version: str | None = None) -> list[str]: Parameters ---------- package_version : str, optional - Specifies the version of the MySQL JDBC driver to use. Defaults to ``8.3.0``. + Specifies the version of the MySQL JDBC driver to use. Defaults to ``8.4.0``. Examples -------- @@ -138,7 +138,7 @@ def get_packages(cls, package_version: str | None = None) -> list[str]: # specify a custom package version MySQL.get_packages(package_version="8.2.0") """ - default_version = "8.3.0" + default_version = "8.4.0" version = Version(package_version or default_version).min_digits(3) return [f"com.mysql:mysql-connector-j:{version}"] @@ -148,7 +148,7 @@ def package(cls) -> str: """Get package name to be downloaded by Spark.""" msg = "`MySQL.package` will be removed in 1.0.0, use `MySQL.get_packages()` instead" warnings.warn(msg, UserWarning, stacklevel=3) - return "com.mysql:mysql-connector-j:8.3.0" + return "com.mysql:mysql-connector-j:8.4.0" @property def jdbc_url(self) -> str: diff --git a/tests/tests_unit/tests_db_connection_unit/test_mysql_unit.py b/tests/tests_unit/tests_db_connection_unit/test_mysql_unit.py index da9267586..e95b34f1a 100644 --- a/tests/tests_unit/tests_db_connection_unit/test_mysql_unit.py +++ b/tests/tests_unit/tests_db_connection_unit/test_mysql_unit.py @@ -14,14 +14,14 @@ def test_mysql_class_attributes(): def test_mysql_package(): warning_msg = re.escape("will be removed in 1.0.0, use `MySQL.get_packages()` instead") with pytest.warns(UserWarning, match=warning_msg): - assert MySQL.package == "com.mysql:mysql-connector-j:8.3.0" + assert MySQL.package == "com.mysql:mysql-connector-j:8.4.0" @pytest.mark.parametrize( "package_version, expected_packages", [ - (None, ["com.mysql:mysql-connector-j:8.3.0"]), - ("8.3.0", ["com.mysql:mysql-connector-j:8.3.0"]), + (None, ["com.mysql:mysql-connector-j:8.4.0"]), + ("8.4.0", ["com.mysql:mysql-connector-j:8.4.0"]), ("8.1.0", ["com.mysql:mysql-connector-j:8.1.0"]), ("8.0.33", ["com.mysql:mysql-connector-j:8.0.33"]), ],