]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Use tuple for function package names
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 19 Mar 2021 18:52:59 +0000 (14:52 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 19 Mar 2021 18:52:59 +0000 (14:52 -0400)
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.

Fixes: #6101
Change-Id: I1d4bb5bf230b83596c59b6a04aa498f18ecd9613

doc/build/changelog/unreleased_14/6101.rst [new file with mode: 0644]
lib/sqlalchemy/sql/functions.py
test/sql/test_compare.py

diff --git a/doc/build/changelog/unreleased_14/6101.rst b/doc/build/changelog/unreleased_14/6101.rst
new file mode 100644 (file)
index 0000000..131a8e7
--- /dev/null
@@ -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.
+
index 40af73d7a26653a29f442d3e6fa662224d67c7d0..d71926a1f9797023950510da9d443a935b9ab831 100644 (file)
@@ -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
         )
 
 
index 9a4b8b1996d9be69dd67a5d4d0c63078ee28e33a..02dd0661a5a3737a7db147c5685defcd990e5449 100644 (file)
@@ -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")),