From e4993e6d888aa4359a04ab62ea7b0875db770a79 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Thu, 14 Dec 2023 12:17:01 +0100 Subject: [PATCH 1/4] unintrusive fix for converter tests --- .../interval_to_bgzip_converter.xml | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml b/lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml index 52e1e8d7b98f..6bc11fb5888d 100644 --- a/lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml +++ b/lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml @@ -40,9 +40,12 @@ - + + + + @@ -50,6 +53,9 @@ + + + @@ -60,9 +66,12 @@ - + + + + @@ -70,20 +79,25 @@ - + + + + + + + - - + + + @@ -92,9 +106,14 @@ - + + + + + + - + From dc8275cb869aac72d8d05b7f127eacd439ff831f Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Thu, 14 Dec 2023 12:20:55 +0100 Subject: [PATCH 2/4] slighly more intrusive fix --- .../interval_to_bgzip_converter.xml | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml b/lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml index 6bc11fb5888d..fe1df3514d19 100644 --- a/lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml +++ b/lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml @@ -40,10 +40,7 @@ - - - - + @@ -52,9 +49,6 @@ - - - @@ -66,9 +60,6 @@ - - - @@ -79,9 +70,6 @@ - - - @@ -91,9 +79,6 @@ - - - @@ -106,11 +91,6 @@ - - - - - From 07bf0d6955fdbdd04c4e33b790a2b0b840209abe Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Thu, 14 Dec 2023 14:50:11 +0100 Subject: [PATCH 3/4] Also fix test of the vcf_to_vcf_bgzip_converter --- lib/galaxy/datatypes/converters/vcf_to_vcf_bgzip_converter.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/datatypes/converters/vcf_to_vcf_bgzip_converter.xml b/lib/galaxy/datatypes/converters/vcf_to_vcf_bgzip_converter.xml index 41617707e2b9..f6ebadcf1d34 100644 --- a/lib/galaxy/datatypes/converters/vcf_to_vcf_bgzip_converter.xml +++ b/lib/galaxy/datatypes/converters/vcf_to_vcf_bgzip_converter.xml @@ -17,7 +17,7 @@ - + From 1113f4c7441b49afd0acb8611b16fa91c8c41c1f Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sat, 23 Dec 2023 10:34:11 +0100 Subject: [PATCH 4/4] Fix User.current_galaxy_session --- lib/galaxy/model/__init__.py | 4 +++- test/unit/data/test_galaxy_mapping.py | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 722afb197ff7..c19ec9770bcf 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -10761,7 +10761,9 @@ class CleanupEventImplicitlyConvertedDatasetAssociationAssociation(Base): # See https://github.com/sqlalchemy/sqlalchemy/discussions/7638 for approach session_partition = select( GalaxySession, - func.row_number().over(order_by=GalaxySession.update_time, partition_by=GalaxySession.user_id).label("index"), + func.row_number() + .over(order_by=GalaxySession.update_time.desc(), partition_by=GalaxySession.user_id) + .label("index"), ).alias() partitioned_session = aliased(GalaxySession, session_partition) User.current_galaxy_session = relationship( diff --git a/test/unit/data/test_galaxy_mapping.py b/test/unit/data/test_galaxy_mapping.py index ccda99693847..1f19f0df8600 100644 --- a/test/unit/data/test_galaxy_mapping.py +++ b/test/unit/data/test_galaxy_mapping.py @@ -698,6 +698,17 @@ def _non_empty_flush(self): session.add(lf) session.flush() + def test_current_session(self): + user = model.User(email="testworkflows@bx.psu.edu", password="password") + galaxy_session = model.GalaxySession() + galaxy_session.user = user + self.persist(user, galaxy_session) + assert user.current_galaxy_session == galaxy_session + new_galaxy_session = model.GalaxySession() + new_galaxy_session.user = user + self.persist(user, new_galaxy_session) + assert user.current_galaxy_session == new_galaxy_session + def test_flush_refreshes(self): # Normally I don't believe in unit testing library code, but the behaviors around attribute # states and flushing in SQL Alchemy is very subtle and it is good to have a executable