You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by as...@apache.org on 2021/04/15 13:52:39 UTC

[airflow] branch v2-0-test updated: Don't import mysql exceptions from "private" module (#15039)

This is an automated email from the ASF dual-hosted git repository.

ash pushed a commit to branch v2-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v2-0-test by this push:
     new 79ff590  Don't import mysql exceptions from "private" module (#15039)
79ff590 is described below

commit 79ff59074da9907f92994160a31c9fbbdf586689
Author: Ash Berlin-Taylor <as...@firemirror.com>
AuthorDate: Fri Mar 26 21:04:08 2021 +0000

    Don't import mysql exceptions from "private" module (#15039)
    
    This module was removed/renamed in mysqlclient 2.0 -- this new name
    works for both
    
    (cherry picked from commit a162f2b0e0a219933d5fc3e5f5fe01968fcc2939)
---
 tests/providers/google/cloud/transfers/test_mysql_to_gcs.py | 2 +-
 tests/providers/mysql/operators/test_mysql.py               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/providers/google/cloud/transfers/test_mysql_to_gcs.py b/tests/providers/google/cloud/transfers/test_mysql_to_gcs.py
index 1e18c20..a76bfb5 100644
--- a/tests/providers/google/cloud/transfers/test_mysql_to_gcs.py
+++ b/tests/providers/google/cloud/transfers/test_mysql_to_gcs.py
@@ -22,7 +22,7 @@ import unittest
 from unittest import mock
 
 import pytest
-from _mysql_exceptions import ProgrammingError
+from MySQLdb import ProgrammingError  # pylint: disable=no-name-in-module
 from parameterized import parameterized
 
 from airflow.providers.google.cloud.transfers.mysql_to_gcs import MySQLToGCSOperator
diff --git a/tests/providers/mysql/operators/test_mysql.py b/tests/providers/mysql/operators/test_mysql.py
index 95b42a3..c8d3128 100644
--- a/tests/providers/mysql/operators/test_mysql.py
+++ b/tests/providers/mysql/operators/test_mysql.py
@@ -102,7 +102,7 @@ class TestMySql(unittest.TestCase):
                 database="foobar",
             )
 
-            from _mysql_exceptions import OperationalError
+            from MySQLdb import OperationalError  # pylint: disable=no-name-in-module
 
             try:
                 op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, ignore_ti_state=True)