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

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


The following commit(s) were added to refs/heads/v2-11-test by this push:
     new 1cb91a05f9a Fix static checks in v2-11-test branch (#52034)
1cb91a05f9a is described below

commit 1cb91a05f9ad91a8f9037dcbe0d06154201337f8
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Jun 22 21:01:19 2025 +0200

    Fix static checks in v2-11-test branch (#52034)
---
 .../providers/apache/hive/transfers/mssql_to_hive.py   |  8 ++++----
 airflow/providers/google/ads/hooks/ads.py              |  4 ++--
 airflow/providers/openai/hooks/openai.py               | 18 +++++++++---------
 airflow/providers/oracle/hooks/oracle.py               |  2 +-
 scripts/in_container/update_quarantined_test_status.py |  2 +-
 tests/providers/openai/hooks/test_openai.py            |  2 +-
 6 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/airflow/providers/apache/hive/transfers/mssql_to_hive.py 
b/airflow/providers/apache/hive/transfers/mssql_to_hive.py
index 79b5dae27ac..d052a1e114c 100644
--- a/airflow/providers/apache/hive/transfers/mssql_to_hive.py
+++ b/airflow/providers/apache/hive/transfers/mssql_to_hive.py
@@ -103,9 +103,9 @@ class MsSqlToHiveOperator(BaseOperator):
     def type_map(cls, mssql_type: int) -> str:
         """Map MsSQL type to Hive type."""
         map_dict = {
-            pymssql.BINARY.value: "INT",
-            pymssql.DECIMAL.value: "FLOAT",
-            pymssql.NUMBER.value: "INT",
+            pymssql.BINARY.value: "INT",  # type: ignore[attr-defined]
+            pymssql.DECIMAL.value: "FLOAT",  # type: ignore[attr-defined]
+            pymssql.NUMBER.value: "INT",  # type: ignore[attr-defined]
         }
         return map_dict.get(mssql_type, "STRING")
 
@@ -121,7 +121,7 @@ class MsSqlToHiveOperator(BaseOperator):
                     for col_count, field in enumerate(cursor.description, 
start=1):
                         col_position = f"Column{col_count}"
                         field_dict[col_position if field[0] == "" else 
field[0]] = self.type_map(field[1])
-                    csv_writer.writerows(cursor)
+                    csv_writer.writerows(cursor)  # type: ignore[arg-type]
                     tmp_file.flush()
 
             hive = HiveCliHook(hive_cli_conn_id=self.hive_cli_conn_id, 
auth=self.hive_auth)
diff --git a/airflow/providers/google/ads/hooks/ads.py 
b/airflow/providers/google/ads/hooks/ads.py
index 992993f47c6..9b9d8f1b00c 100644
--- a/airflow/providers/google/ads/hooks/ads.py
+++ b/airflow/providers/google/ads/hooks/ads.py
@@ -176,7 +176,7 @@ class GoogleAdsHook(BaseHook):
         """
         try:
             accessible_customers = 
self._get_customer_service.list_accessible_customers()
-            return accessible_customers.resource_names
+            return accessible_customers.resource_names  # type: 
ignore[return-value]
         except GoogleAdsException as ex:
             for error in ex.failure.errors:
                 self.log.error('\tError with message "%s".', error.message)
@@ -290,7 +290,7 @@ class GoogleAdsHook(BaseHook):
 
         self.log.info("Fetched Google Ads Iterators")
 
-        return self._extract_rows(iterators)
+        return self._extract_rows(iterators)  # type: ignore[arg-type]
 
     def _extract_rows(self, iterators: list[GRPCIterator]) -> 
list[GoogleAdsRow]:
         """
diff --git a/airflow/providers/openai/hooks/openai.py 
b/airflow/providers/openai/hooks/openai.py
index e66283afd61..eea0e52e4cd 100644
--- a/airflow/providers/openai/hooks/openai.py
+++ b/airflow/providers/openai/hooks/openai.py
@@ -24,7 +24,7 @@ from openai import OpenAI
 
 if TYPE_CHECKING:
     from openai.types import FileDeleted, FileObject
-    from openai.types.beta import (
+    from openai.types.beta import (  # type: ignore[attr-defined]
         Assistant,
         AssistantDeleted,
         Thread,
@@ -325,12 +325,12 @@ class OpenAIHook(BaseHook):
 
     def create_vector_store(self, **kwargs: Any) -> VectorStore:
         """Create a vector store."""
-        vector_store = self.conn.beta.vector_stores.create(**kwargs)
+        vector_store = self.conn.beta.vector_stores.create(**kwargs)  # type: 
ignore[attr-defined]
         return vector_store
 
     def get_vector_stores(self, **kwargs: Any) -> list[VectorStore]:
         """Return a list of vector stores."""
-        vector_stores = self.conn.beta.vector_stores.list(**kwargs)
+        vector_stores = self.conn.beta.vector_stores.list(**kwargs)  # type: 
ignore[attr-defined]
         return vector_stores.data
 
     def get_vector_store(self, vector_store_id: str) -> VectorStore:
@@ -339,7 +339,7 @@ class OpenAIHook(BaseHook):
 
         :param vector_store_id: The ID of the vector store to retrieve.
         """
-        vector_store = 
self.conn.beta.vector_stores.retrieve(vector_store_id=vector_store_id)
+        vector_store = 
self.conn.beta.vector_stores.retrieve(vector_store_id=vector_store_id)  # type: 
ignore[attr-defined]
         return vector_store
 
     def modify_vector_store(self, vector_store_id: str, **kwargs: Any) -> 
VectorStore:
@@ -348,7 +348,7 @@ class OpenAIHook(BaseHook):
 
         :param vector_store_id: The ID of the vector store to modify.
         """
-        vector_store = 
self.conn.beta.vector_stores.update(vector_store_id=vector_store_id, **kwargs)
+        vector_store = 
self.conn.beta.vector_stores.update(vector_store_id=vector_store_id, **kwargs)  
# type: ignore[attr-defined]
         return vector_store
 
     def delete_vector_store(self, vector_store_id: str) -> VectorStoreDeleted:
@@ -357,7 +357,7 @@ class OpenAIHook(BaseHook):
 
         :param vector_store_id: The ID of the vector store to delete.
         """
-        response = 
self.conn.beta.vector_stores.delete(vector_store_id=vector_store_id)
+        response = 
self.conn.beta.vector_stores.delete(vector_store_id=vector_store_id)  # type: 
ignore[attr-defined]
         return response
 
     def upload_files_to_vector_store(
@@ -370,7 +370,7 @@ class OpenAIHook(BaseHook):
             to.
         :param files: A list of binary files to upload.
         """
-        file_batch = self.conn.beta.vector_stores.file_batches.upload_and_poll(
+        file_batch = 
self.conn.beta.vector_stores.file_batches.upload_and_poll(  # type: 
ignore[attr-defined]
             vector_store_id=vector_store_id, files=files
         )
         return file_batch
@@ -381,7 +381,7 @@ class OpenAIHook(BaseHook):
 
         :param vector_store_id:
         """
-        vector_store_files = 
self.conn.beta.vector_stores.files.list(vector_store_id=vector_store_id)
+        vector_store_files = 
self.conn.beta.vector_stores.files.list(vector_store_id=vector_store_id)  # 
type: ignore[attr-defined]
         return vector_store_files.data
 
     def delete_vector_store_file(self, vector_store_id: str, file_id: str) -> 
VectorStoreFileDeleted:
@@ -391,5 +391,5 @@ class OpenAIHook(BaseHook):
         :param vector_store_id: The ID of the vector store that the file 
belongs to.
         :param file_id: The ID of the file to delete.
         """
-        response = 
self.conn.beta.vector_stores.files.delete(vector_store_id=vector_store_id, 
file_id=file_id)
+        response = 
self.conn.beta.vector_stores.files.delete(vector_store_id=vector_store_id, 
file_id=file_id)  # type: ignore[attr-defined]
         return response
diff --git a/airflow/providers/oracle/hooks/oracle.py 
b/airflow/providers/oracle/hooks/oracle.py
index a252a7599cd..46131fe74f7 100644
--- a/airflow/providers/oracle/hooks/oracle.py
+++ b/airflow/providers/oracle/hooks/oracle.py
@@ -234,7 +234,7 @@ class OracleHook(DbApiHook):
         elif purity == "default":
             conn_config["purity"] = oracledb.PURITY_DEFAULT
 
-        conn = oracledb.connect(**conn_config)
+        conn = oracledb.connect(**conn_config)  # type: ignore[assignment]
         if mod is not None:
             conn.module = mod
 
diff --git a/scripts/in_container/update_quarantined_test_status.py 
b/scripts/in_container/update_quarantined_test_status.py
index 72cd04c33ea..5c55632ec1a 100755
--- a/scripts/in_container/update_quarantined_test_status.py
+++ b/scripts/in_container/update_quarantined_test_status.py
@@ -181,7 +181,7 @@ if __name__ == "__main__":
     with open(sys.argv[1]) as f:
         text = f.read()
     y = BeautifulSoup(text, "html.parser")
-    res = y.testsuites.testsuite.findAll("testcase")
+    res = y.testsuites.testsuite.findAll("testcase")  # type: 
ignore[union-attr,call-arg]
     for test in res:
         print("Parsing: " + test["classname"] + "::" + test["name"])
         if test.contents and test.contents[0].name == "skipped":
diff --git a/tests/providers/openai/hooks/test_openai.py 
b/tests/providers/openai/hooks/test_openai.py
index a4e4cdbbbf2..14ff7ae2131 100644
--- a/tests/providers/openai/hooks/test_openai.py
+++ b/tests/providers/openai/hooks/test_openai.py
@@ -27,7 +27,7 @@ from unittest.mock import mock_open
 
 from openai.pagination import SyncCursorPage
 from openai.types import CreateEmbeddingResponse, Embedding, FileDeleted, 
FileObject
-from openai.types.beta import (
+from openai.types.beta import (  # type: ignore[attr-defined]
     Assistant,
     AssistantDeleted,
     Thread,

Reply via email to