diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2023-05-10 15:11:06 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2023-05-10 15:11:06 +0000 |
| commit | bce61160a9aec321ea0af4a59d4b83ff93a0429f (patch) | |
| tree | 3754696c2d8f97d92507309ef4c13037b7372bf3 /lib/sqlalchemy/orm/query.py | |
| parent | 987285fb4b13c39bcc6b8922e618d9e830577dda (diff) | |
| parent | 60b31198311eedfa3814e7098c94d3aa29338fdd (diff) | |
| download | sqlalchemy-bce61160a9aec321ea0af4a59d4b83ff93a0429f.tar.gz | |
Merge "fix test suite warnings" into main
Diffstat (limited to 'lib/sqlalchemy/orm/query.py')
| -rw-r--r-- | lib/sqlalchemy/orm/query.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 5cd7cc117..e6381bee1 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -1436,7 +1436,13 @@ class Query( to the given list of columns """ + return self._values_no_warn(*columns) + _values = values + + def _values_no_warn( + self, *columns: _ColumnsClauseArgument[Any] + ) -> Iterable[Any]: if not columns: return iter(()) q = self._clone().enable_eagerloads(False) @@ -1445,8 +1451,6 @@ class Query( q.load_options += {"_yield_per": 10} return iter(q) # type: ignore - _values = values - @util.deprecated( "1.4", ":meth:`_query.Query.value` " @@ -1460,7 +1464,7 @@ class Query( """ try: - return next(self.values(column))[0] # type: ignore + return next(self._values_no_warn(column))[0] # type: ignore except StopIteration: return None @@ -3332,7 +3336,7 @@ class AliasOption(interfaces.LoaderOption): @util.deprecated( "1.4", - "The :class:`.AliasOption` is not necessary " + "The :class:`.AliasOption` object is not necessary " "for entities to be matched up to a query that is established " "via :meth:`.Query.from_statement` and now does nothing.", ) |
