summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/elements.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-10-13 12:00:52 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-10-13 13:52:23 -0400
commit53ad3cf4e9b02f841fff960ec95870110f6c7bcb (patch)
tree61695ea261585be3b555817dbe3d92554f38704f /lib/sqlalchemy/sql/elements.py
parentde9db9940fbcf32ccd93169d2ed6aa874869b84d (diff)
downloadsqlalchemy-53ad3cf4e9b02f841fff960ec95870110f6c7bcb.tar.gz
Pickling fixes for ORM / Core
Fixed regression where ORM loaded objects could not be pickled in cases where loader options making use of ``"*"`` were used in certain combinations, such as combining the :func:`_orm.joinedload` loader strategy with ``raiseload('*')`` of sub-elements. Fixes: #7134 Fixed issue where SQL queries using the :meth:`_functions.FunctionElement.within_group` construct could not be pickled, typically when using the ``sqlalchemy.ext.serializer`` extension but also for general generic pickling. Fixes: #6520 Change-Id: Ib73fd49c875e6da9898493c190f610e68b88ec72
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r--lib/sqlalchemy/sql/elements.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index 6f1756af3..e49665019 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -4319,6 +4319,9 @@ class WithinGroup(ColumnElement):
*util.to_list(order_by), _literal_as_text_role=roles.ByOfRole
)
+ def __reduce__(self):
+ return self.__class__, (self.element,) + tuple(self.order_by)
+
def over(self, partition_by=None, order_by=None, range_=None, rows=None):
"""Produce an OVER clause against this :class:`.WithinGroup`
construct.