You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2026/01/14 16:11:00 UTC
(airflow) branch main updated: checking session.query() (#60510)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 62f28049c76 checking session.query() (#60510)
62f28049c76 is described below
commit 62f28049c760809d62628a831747c7a2af92394a
Author: Pratiksha <12...@users.noreply.github.com>
AuthorDate: Wed Jan 14 21:40:52 2026 +0530
checking session.query() (#60510)
---
scripts/ci/prek/prevent_deprecated_sqlalchemy_usage.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scripts/ci/prek/prevent_deprecated_sqlalchemy_usage.py b/scripts/ci/prek/prevent_deprecated_sqlalchemy_usage.py
index 8c6d11262ea..228b0c504d0 100755
--- a/scripts/ci/prek/prevent_deprecated_sqlalchemy_usage.py
+++ b/scripts/ci/prek/prevent_deprecated_sqlalchemy_usage.py
@@ -36,7 +36,11 @@ def check_session_query(mod: ast.Module, file_path: str) -> bool:
errors = False
for node in ast.walk(mod):
if isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute):
- if node.func.attr == "query":
+ if (
+ node.func.attr == "query"
+ and isinstance(node.func.value, ast.Name)
+ and node.func.value.id == "session"
+ ):
console.print(f"Deprecated query-obj found at line {node.lineno} in {file_path}.")
errors = True
if isinstance(node, ast.ImportFrom):