From: oleg Date: Tue, 5 Mar 2024 13:18:36 +0000 (-0500) Subject: Inline _get_bind_args method. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=770b779ba4cbb1b890ba020b7e3d8f6bfab5e861;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Inline _get_bind_args method. ### Description _get_bind_args is strange method in query module. It is called only in one place. It takes self(but don't use it) and two args with Any type. I think it must be static method with typehints if it will has more use cases in the future. But now removing is more simple solution. ### Checklist This pull request is: - [x] A short code fix **Have a nice day!** Closes: #11098 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11098 Pull-request-sha: dc997911a68e455419080a782778c56eceaa76f5 Change-Id: I53b960b3f2864a2db24ffa0058ab0569a721b11a --- diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 3a94340052..bfc0fb3652 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -2871,7 +2871,7 @@ class Query( try: bind = ( - self._get_bind_args(statement, self.session.get_bind) + self.session.get_bind(clause=statement) if self.session else None ) @@ -2880,9 +2880,6 @@ class Query( return str(statement.compile(bind)) - def _get_bind_args(self, statement: Any, fn: Any, **kw: Any) -> Any: - return fn(clause=statement, **kw) - @property def column_descriptions(self) -> List[ORMColumnDescription]: """Return metadata about the columns which would be