From 14aa3e9af6af8268d13c6174218794b1bb93bb6d Mon Sep 17 00:00:00 2001 From: Jeremy Nelson Date: Mon, 4 Nov 2024 12:29:37 -0800 Subject: [PATCH] bug: Ignores type error for SQLExecuteQueryOperator mypy is getting confused because the execute method does return values (but no type hint is provided for the method) https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.3.1/_modules/airflow/providers/common/sql/operators/sql.html#SQLExecuteQueryOperator --- libsys_airflow/plugins/data_exports/full_dump_marc.py | 4 +++- libsys_airflow/plugins/data_exports/instance_ids.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libsys_airflow/plugins/data_exports/full_dump_marc.py b/libsys_airflow/plugins/data_exports/full_dump_marc.py index d827879f..92403248 100644 --- a/libsys_airflow/plugins/data_exports/full_dump_marc.py +++ b/libsys_airflow/plugins/data_exports/full_dump_marc.py @@ -39,7 +39,9 @@ def fetch_number_of_records(**kwargs) -> int: conn_id="postgres_folio", database=kwargs.get("database", "okapi"), sql=query, - ).execute(context) + ).execute( + context + ) # type: ignore count = result[0][0] logger.info(f"Record count: {count}") diff --git a/libsys_airflow/plugins/data_exports/instance_ids.py b/libsys_airflow/plugins/data_exports/instance_ids.py index 2c2e6b1f..fdf10b43 100644 --- a/libsys_airflow/plugins/data_exports/instance_ids.py +++ b/libsys_airflow/plugins/data_exports/instance_ids.py @@ -51,7 +51,9 @@ def fetch_record_ids(**kwargs) -> dict: "from_date": from_date, "to_date": to_date, }, - ).execute(context) + ).execute( + context + ) # type: ignore ) results[kind] = list(np.unique(results[kind]))