From 013ce920443679ebf02e6709929ece1457d8747d Mon Sep 17 00:00:00 2001 From: Ash Berlin-Taylor Date: Fri, 26 Mar 2021 20:03:13 +0000 Subject: [PATCH] Don't import mysql exceptions from "private" module This module was removed/renamed in mysqlclient 2.0 -- this new name works for both --- 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 1e18c201f112e..a76bfb5d904bd 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 @@ 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 af5cc25e122d2..73a5b73094695 100644 --- a/tests/providers/mysql/operators/test_mysql.py +++ b/tests/providers/mysql/operators/test_mysql.py @@ -100,7 +100,7 @@ def test_overwrite_schema(self, client): 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)