This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 8943b46e005f92da203a1a42cc9206ea4dedb5f6
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jan 16 08:52:28 2026 +0100
[v3-1-test] checking session.query() (#60510) (#60530)
(cherry picked from commit 62f28049c760809d62628a831747c7a2af92394a)
Co-authored-by: Pratiksha <[email protected]>
---
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 7dd9ca9dd6c..6ba23384922 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
return errors