diff --git a/airflow/providers/apache/hive/transfers/mysql_to_hive.py b/airflow/providers/apache/hive/transfers/mysql_to_hive.py index ab0b1c9a32dd5..4a478ef996299 100644 --- a/airflow/providers/apache/hive/transfers/mysql_to_hive.py +++ b/airflow/providers/apache/hive/transfers/mysql_to_hive.py @@ -149,7 +149,7 @@ def execute(self, context: Context): csv_writer.writerows(cursor) f.flush() cursor.close() - conn.close() + conn.close() # type: ignore[misc] self.log.info("Loading file into Hive") hive.load_file( f.name, diff --git a/airflow/providers/mysql/hooks/mysql.py b/airflow/providers/mysql/hooks/mysql.py index 83a25f1aeda6a..ea2d912a62c61 100644 --- a/airflow/providers/mysql/hooks/mysql.py +++ b/airflow/providers/mysql/hooks/mysql.py @@ -78,7 +78,7 @@ def set_autocommit(self, conn: MySQLConnectionTypes, autocommit: bool) -> None: if hasattr(conn.__class__, "autocommit") and isinstance(conn.__class__.autocommit, property): conn.autocommit = autocommit else: - conn.autocommit(autocommit) + conn.autocommit(autocommit) # type: ignore[operator] def get_autocommit(self, conn: MySQLConnectionTypes) -> bool: """ @@ -93,7 +93,7 @@ def get_autocommit(self, conn: MySQLConnectionTypes) -> bool: if hasattr(conn.__class__, "autocommit") and isinstance(conn.__class__.autocommit, property): return conn.autocommit else: - return conn.get_autocommit() + return conn.get_autocommit() # type: ignore[union-attr] def _get_conn_config_mysql_client(self, conn: Connection) -> dict: conn_config = { @@ -199,7 +199,7 @@ def bulk_load(self, table: str, tmp_file: str) -> None: """ ) conn.commit() - conn.close() + conn.close() # type: ignore[misc] def bulk_dump(self, table: str, tmp_file: str) -> None: """Dump a database table into a tab-delimited file.""" @@ -212,7 +212,7 @@ def bulk_dump(self, table: str, tmp_file: str) -> None: """ ) conn.commit() - conn.close() + conn.close() # type: ignore[misc] @staticmethod def _serialize_cell(cell: object, conn: Connection | None = None) -> Any: @@ -283,4 +283,4 @@ def bulk_load_custom( cursor.close() conn.commit() - conn.close() + conn.close() # type: ignore[misc]