]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix relationship.order_by typing 8779/head
authorBryan Forbes <bryan@reigndropsfall.net>
Tue, 8 Nov 2022 21:32:02 +0000 (15:32 -0600)
committerBryan Forbes <bryan@reigndropsfall.net>
Tue, 8 Nov 2022 21:34:45 +0000 (15:34 -0600)
Fixes: #8776
doc/build/changelog/unreleased_20/8776.rst [new file with mode: 0644]
lib/sqlalchemy/orm/relationships.py

diff --git a/doc/build/changelog/unreleased_20/8776.rst b/doc/build/changelog/unreleased_20/8776.rst
new file mode 100644 (file)
index 0000000..fa4156e
--- /dev/null
@@ -0,0 +1,7 @@
+.. change::
+    :tags: bug, orm
+    :tickets: 8776
+
+    Fixed issue where passing a callbale function returning an iterable
+    of column elements to :paramref:`_orm.relationship.order_by` was
+    flagged as an error in type checkers.
index e0922a5380f7a3ae90990726bdb5a9b8ef6be740..986093e02533e80c0dd9a385fb5dbf589712e0e9 100644 (file)
@@ -164,6 +164,7 @@ _ORMOrderByArgument = Union[
     Literal[False],
     str,
     _ColumnExpressionArgument[Any],
+    Callable[[], Iterable[ColumnElement[Any]]],
     Iterable[Union[str, _ColumnExpressionArgument[Any]]],
 ]
 _ORMBackrefArgument = Union[str, Tuple[str, Dict[str, Any]]]