Skip to content

Commit f5d0a67

Browse files
pratiksha rajendrabhai badhekapratiksha rajendrabhai badheka
pratiksha rajendrabhai badheka
authored and
pratiksha rajendrabhai badheka
committed
modified error message
1 parent af10cd6 commit f5d0a67

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/ci/pre_commit/usage_session_query.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ def check_session_query(mod: ast.Module) -> int:
3636
and isinstance(node.func.value, ast.Name)
3737
and node.func.value.id == "session"
3838
):
39-
console.print(f"Remove session.query from line {node.lineno}")
39+
console.print(
40+
f"\nUse of legacy `session.query` detected on line {node.lineno}. "
41+
f"\nSQLAlchemy 2.0 deprecates the `Query` object"
42+
f"use the `select()` construct instead."
43+
)
4044
errors += 1
4145
return errors
4246

0 commit comments

Comments
 (0)