#4460 Make pagure work with recent sqlalchemy versions
Opened 3 months ago by pingou. Modified 3 months ago

file modified
+8 -6

@@ -2493,13 +2493,15 @@ 

                  model.PagureGroup.group_name.notin_(exclude_groups)

              )

  

+         sublist = (

+             subquery0.union(sub_q1).union(sub_q2).union(sub_q3).union(sub_q4)

+         )

+ 

+         # I am quite displeased about running the query here instead of using

+         # a subquery but if we do use a subquery we're crashing on sqlalchemy

+         # >= 1.3.0

          projects = projects.filter(

-             model.Project.id.in_(

-                 subquery0.union(sub_q1)

-                 .union(sub_q2)

-                 .union(sub_q3)

-                 .union(sub_q4)

-             )

+             model.Project.id.in_([it[0] for it in sublist.all()])

          )

  

      if fork is not None:

file modified
+2 -1

@@ -31,7 +31,8 @@ 

  # test_pagure_lib.py to raise a:

  # "(sqlite3.OperationalError) no such column: users.user"

  # in test_search_projects_private line 319

- sqlalchemy < 1.3.0

+ #sqlalchemy < 1.3.0

+ sqlalchemy

Our minimum version is still 0.8

  # 1.4.0 is broken, 1.4.0-post-1 works but gives odd results on newer setuptools

  # the latest version 1.5.0 is also known to work

  straight.plugin

What's the impact of this change, performance wise?

Unknown at this time.

Tbh, I really dislike this solution :(

rebased onto 2bc92e7

3 months ago

Have you forwarded the breakage to SQLAlchemy upstream?

Have you forwarded the breakage to SQLAlchemy upstream?

Discussing with @puiterwijk he believes it's not a SQLAlchemy issue but a pagure one.

Our minimum version is still 0.8