From adc950945025d436ef97095b4e706700ebae34ff Mon Sep 17 00:00:00 2001 From: Bryan Forbes Date: Thu, 15 Apr 2021 12:35:52 -0500 Subject: Derive `next_value.type` from `Sequence.data_type` if available Fixes #6287 Change-Id: I7d428ed86cd72cd910bfff9058a52c7fcb7c64ac --- lib/sqlalchemy/sql/functions.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index d71926a1f..02ed55100 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -1064,6 +1064,9 @@ class next_value(GenericFunction): ), "next_value() accepts a Sequence object as input." self._bind = self._get_bind(kw) self.sequence = seq + self.type = sqltypes.to_instance( + seq.data_type or getattr(self, "type", None) + ) def compare(self, other, **kw): return ( -- cgit v1.2.1