]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Inline _get_bind_args method.
authoroleg <giulfjmnfyhj@rambler.ru>
Tue, 5 Mar 2024 13:18:36 +0000 (08:18 -0500)
committersqla-tester <sqla-tester@sqlalchemy.org>
Tue, 5 Mar 2024 13:18:36 +0000 (08:18 -0500)
<!-- Provide a general summary of your proposed changes in the Title field above -->

### 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

lib/sqlalchemy/orm/query.py

index 3a94340052688e7bf6a99421ed149231347153df..bfc0fb36527c1fc226991391344e602d5f0121fa 100644 (file)
@@ -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