Hello community,

here is the log from the commit of package python-SQLAlchemy-Utils for 
openSUSE:Factory checked in at 2017-11-08 15:10:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-SQLAlchemy-Utils (Old)
 and      /work/SRC/openSUSE:Factory/.python-SQLAlchemy-Utils.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-SQLAlchemy-Utils"

Wed Nov  8 15:10:01 2017 rev:6 rq:536030 version:0.32.19

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-SQLAlchemy-Utils/python-SQLAlchemy-Utils.changes
  2017-10-09 19:48:42.878282572 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-SQLAlchemy-Utils.new/python-SQLAlchemy-Utils.changes
     2017-11-08 15:10:17.905687117 +0100
@@ -1,0 +2,7 @@
+Tue Oct 17 16:05:33 UTC 2017 - [email protected]
+
+- update to version 0.32.19:
+  * Fixed select_correlated_expression order by for intermediate table
+    aliases
+
+-------------------------------------------------------------------

Old:
----
  SQLAlchemy-Utils-0.32.18.tar.gz

New:
----
  SQLAlchemy-Utils-0.32.19.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-SQLAlchemy-Utils.spec ++++++
--- /var/tmp/diff_new_pack.aybEof/_old  2017-11-08 15:10:18.933649589 +0100
+++ /var/tmp/diff_new_pack.aybEof/_new  2017-11-08 15:10:18.933649589 +0100
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-SQLAlchemy-Utils
-Version:        0.32.18
+Version:        0.32.19
 Release:        0
 Summary:        Various utility functions for SQLAlchemy
 License:        BSD-3-Clause

++++++ SQLAlchemy-Utils-0.32.18.tar.gz -> SQLAlchemy-Utils-0.32.19.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.32.18/CHANGES.rst 
new/SQLAlchemy-Utils-0.32.19/CHANGES.rst
--- old/SQLAlchemy-Utils-0.32.18/CHANGES.rst    2017-10-06 09:17:30.000000000 
+0200
+++ new/SQLAlchemy-Utils-0.32.19/CHANGES.rst    2017-10-17 10:34:46.000000000 
+0200
@@ -4,6 +4,12 @@
 Here you can see the full list of changes between each SQLAlchemy-Utils 
release.
 
 
+0.32.19 (2017-10-17)
+^^^^^^^^^^^^^^^^^^^^
+
+- Fixed select_correlated_expression order by for intermediate table aliases
+
+
 0.32.18 (2017-10-06)
 ^^^^^^^^^^^^^^^^^^^^
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.32.18/PKG-INFO 
new/SQLAlchemy-Utils-0.32.19/PKG-INFO
--- old/SQLAlchemy-Utils-0.32.18/PKG-INFO       2017-10-06 09:18:25.000000000 
+0200
+++ new/SQLAlchemy-Utils-0.32.19/PKG-INFO       2017-10-17 10:44:09.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: SQLAlchemy-Utils
-Version: 0.32.18
+Version: 0.32.19
 Summary: Various utility functions for SQLAlchemy.
 Home-page: https://github.com/kvesteri/sqlalchemy-utils
 Author: Konsta Vesterinen, Ryan Leckey, Janne Vanhala, Vesa Uimonen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SQLAlchemy-Utils-0.32.18/SQLAlchemy_Utils.egg-info/PKG-INFO 
new/SQLAlchemy-Utils-0.32.19/SQLAlchemy_Utils.egg-info/PKG-INFO
--- old/SQLAlchemy-Utils-0.32.18/SQLAlchemy_Utils.egg-info/PKG-INFO     
2017-10-06 09:18:25.000000000 +0200
+++ new/SQLAlchemy-Utils-0.32.19/SQLAlchemy_Utils.egg-info/PKG-INFO     
2017-10-17 10:44:09.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: SQLAlchemy-Utils
-Version: 0.32.18
+Version: 0.32.19
 Summary: Various utility functions for SQLAlchemy.
 Home-page: https://github.com/kvesteri/sqlalchemy-utils
 Author: Konsta Vesterinen, Ryan Leckey, Janne Vanhala, Vesa Uimonen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SQLAlchemy-Utils-0.32.18/sqlalchemy_utils/__init__.py 
new/SQLAlchemy-Utils-0.32.19/sqlalchemy_utils/__init__.py
--- old/SQLAlchemy-Utils-0.32.18/sqlalchemy_utils/__init__.py   2017-10-06 
09:16:21.000000000 +0200
+++ new/SQLAlchemy-Utils-0.32.19/sqlalchemy_utils/__init__.py   2017-10-17 
10:35:09.000000000 +0200
@@ -95,4 +95,4 @@
     WeekDaysType
 )
 
-__version__ = '0.32.18'
+__version__ = '0.32.19'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SQLAlchemy-Utils-0.32.18/sqlalchemy_utils/relationships/__init__.py 
new/SQLAlchemy-Utils-0.32.19/sqlalchemy_utils/relationships/__init__.py
--- old/SQLAlchemy-Utils-0.32.18/sqlalchemy_utils/relationships/__init__.py     
2016-04-25 16:20:06.000000000 +0200
+++ new/SQLAlchemy-Utils-0.32.19/sqlalchemy_utils/relationships/__init__.py     
2017-10-17 10:12:03.000000000 +0200
@@ -95,14 +95,20 @@
     relationships = list(reversed(path_to_relationships(path, root_model)))
 
     query = sa.select([expr])
-    selectable = sa.inspect(leaf_model).selectable
+
+    join_expr, aliases = chained_inverse_join(relationships, leaf_model)
 
     if order_by:
         query = query.order_by(
-            *[adapt_expr(o, selectable) for o in order_by]
+            *[
+                adapt_expr(
+                    o,
+                    *(sa.inspect(alias).selectable for alias in aliases)
+                )
+                for o in order_by
+            ]
         )
 
-    join_expr, aliases = chained_inverse_join(relationships, leaf_model)
     condition = relationship_to_correlation(
         relationships[-1],
         aliases[-1]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SQLAlchemy-Utils-0.32.18/tests/relationships/test_select_correlated_expression.py
 
new/SQLAlchemy-Utils-0.32.19/tests/relationships/test_select_correlated_expression.py
--- 
old/SQLAlchemy-Utils-0.32.18/tests/relationships/test_select_correlated_expression.py
       2016-04-25 16:20:07.000000000 +0200
+++ 
new/SQLAlchemy-Utils-0.32.19/tests/relationships/test_select_correlated_expression.py
       2017-10-17 10:39:27.000000000 +0200
@@ -379,6 +379,25 @@
         ).order_by(model.id)
         assert query.all() == result
 
+    def test_order_by_intermediate_table_column(
+        self,
+        session,
+        model_mapping,
+        group_user_tbl
+    ):
+        model = model_mapping['users']
+        alias = sa.orm.aliased(model_mapping['groups'])
+        aggregate = select_correlated_expression(
+            model,
+            sa.func.json_build_object('id', alias.id),
+            'groups',
+            alias,
+            order_by=[group_user_tbl.c.user_id]
+        ).alias('test')
+        # Just check that the query execution doesn't fail because of wrongly
+        # constructed aliases
+        assert session.execute(aggregate)
+
     def test_with_non_aggregate_function(
         self,
         session,


Reply via email to