This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v1-10-test by this push:
new 530aeb77c5c [v1-10-test] Remove workflow run from v1 10 stable (#45600)
530aeb77c5c is described below
commit 530aeb77c5cbf0fcd53f2517a8b42400a89cdd9e
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Jan 12 19:52:13 2025 +0100
[v1-10-test] Remove workflow run from v1 10 stable (#45600)
* Fix false positive when inheriting class that inherits ``DbApiHook``
(#16543)
closes https://github.com/apache/airflow/issues/14541
* Remove pull_request_target workflow
---------
Co-authored-by: Kaxil Naik <[email protected]>
---
airflow/upgrade/rules/db_api_functions.py | 5 +++--
tests/upgrade/rules/test_db_api_functions.py | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/airflow/upgrade/rules/db_api_functions.py
b/airflow/upgrade/rules/db_api_functions.py
index 0ca730fd287..dbf72d67d9c 100644
--- a/airflow/upgrade/rules/db_api_functions.py
+++ b/airflow/upgrade/rules/db_api_functions.py
@@ -63,8 +63,9 @@ def get_all_non_dbapi_children():
next_generation = []
for child in basehook_children:
subclasses = child.__subclasses__()
- if subclasses:
- next_generation.extend(subclasses)
+ for subclass in subclasses:
+ if all(base_class.__name__ != 'DbApiHook' for base_class in
subclass.__bases__):
+ next_generation.append(subclass)
res.extend(next_generation)
basehook_children = next_generation
return res
diff --git a/tests/upgrade/rules/test_db_api_functions.py
b/tests/upgrade/rules/test_db_api_functions.py
index d73a0414b42..156e7d55152 100644
--- a/tests/upgrade/rules/test_db_api_functions.py
+++ b/tests/upgrade/rules/test_db_api_functions.py
@@ -18,6 +18,7 @@ from unittest import TestCase
from airflow.hooks.base_hook import BaseHook
from airflow.hooks.dbapi_hook import DbApiHook
+from airflow.contrib.hooks.bigquery_hook import BigQueryHook
from airflow.upgrade.rules.db_api_functions import DbApiRule
@@ -41,7 +42,7 @@ class GrandChildHook(MyHook):
pass
-class ProperDbApiHook(DbApiHook):
+class ProperDbApiHook(DbApiHook, BigQueryHook):
def bulk_dump(self, table, tmp_file):
pass