diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 81e24f2e8a3b3..74a1ba02086b0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -413,6 +413,7 @@ repos: ^airflow-ctl.*\.py$| ^airflow-core/src/airflow/models/.*\.py$| ^airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py$| + ^providers/mysql/.*\.py$| ^task_sdk.*\.py$ pass_filenames: true - id: update-supported-versions diff --git a/providers/mysql/tests/unit/mysql/transfers/test_s3_to_mysql.py b/providers/mysql/tests/unit/mysql/transfers/test_s3_to_mysql.py index dca4d4c55088b..1912e2c6a75f5 100644 --- a/providers/mysql/tests/unit/mysql/transfers/test_s3_to_mysql.py +++ b/providers/mysql/tests/unit/mysql/transfers/test_s3_to_mysql.py @@ -19,7 +19,7 @@ from unittest.mock import patch import pytest -from sqlalchemy import or_ +from sqlalchemy import delete, or_ from airflow import models from airflow.providers.mysql.transfers.s3_to_mysql import S3ToMySqlOperator @@ -101,10 +101,8 @@ def test_execute_exception(self, mock_remove, mock_bulk_load_custom, mock_downlo def teardown_method(self): with create_session() as session: - ( - session.query(models.Connection) - .filter( + session.execute( + delete(models.Connection).where( or_(models.Connection.conn_id == "s3_test", models.Connection.conn_id == "mysql_test") ) - .delete() )