diff options
| -rw-r--r-- | doc/build/changelog/unreleased_14/6101.rst | 8 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql/functions.py | 2 | ||||
| -rw-r--r-- | test/sql/test_compare.py | 6 |
3 files changed, 15 insertions, 1 deletions
diff --git a/doc/build/changelog/unreleased_14/6101.rst b/doc/build/changelog/unreleased_14/6101.rst new file mode 100644 index 000000000..131a8e73a --- /dev/null +++ b/doc/build/changelog/unreleased_14/6101.rst @@ -0,0 +1,8 @@ +.. change:: + :tags: bug, sql, regression + :tickets: 6101 + + Fixed issue where using a ``func`` that includes dotted packagenames would + fail to be cacheable by the SQL caching system due to a Python list of + names that needed to be a tuple. + diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index 40af73d7a..d71926a1f 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -790,7 +790,7 @@ class _FunctionGenerator(object): return func(*c, **o) return Function( - self.__names[-1], packagenames=self.__names[0:-1], *c, **o + self.__names[-1], packagenames=tuple(self.__names[0:-1]), *c, **o ) diff --git a/test/sql/test_compare.py b/test/sql/test_compare.py index 9a4b8b199..02dd0661a 100644 --- a/test/sql/test_compare.py +++ b/test/sql/test_compare.py @@ -269,6 +269,12 @@ class CoreFixtures(object): ), lambda: (_OffsetLimitParam("x"), _OffsetLimitParam("y")), lambda: (func.foo(), func.foo(5), func.bar()), + lambda: ( + func.package1.foo(5), + func.package2.foo(5), + func.packge1.bar(5), + func.foo(), + ), lambda: (func.current_date(), func.current_time()), lambda: ( func.next_value(Sequence("q")), |
