dimagi / django-cte

Common Table Expressions (CTE) for Django
Other
334 stars 46 forks source link

Django 4.2 error: each UNION query must have the same number of columns #87

Closed adamanthil closed 7 months ago

adamanthil commented 8 months ago

In Django 4.2, using UNION queries with order by and select_related causes the above error, as originally referenced in https://github.com/dimagi/django-cte/pull/81#issue-1983991580

We're encountering this now in our production code base, and it is currently preventing an update beyond Django 4.1.

Related: https://github.com/dimagi/django-cte/issues/66

millerdev commented 8 months ago

Can you provide an example query that reproduces the issue, preferably using models from the django-cte test suite?

adamanthil commented 8 months ago

Let me work on that and get back to you.

millerdev commented 7 months ago

This can be reopened if more details are provided.