Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tests): Add contains_over_clause #848 #850

Closed
wants to merge 4 commits into from

Conversation

imAsparky
Copy link

Added support for Django 4.2

Adding support for Django 4.2 broke some tests with this error AttributeError: 'ExtraJoinRestriction' object has no attribute 'contains_over_clause'

Tracking the source of the error I have found a change to 38 def split_having(self, negated=False): in django 4.1
to 38 def split_having_qualify(self, negated=False, must_group_by=False): in django 4.2 which is causing the error.

The 'contains_over_clause' Attribute Tells Django that this expression contains a Window expression. It’s used, for example, to disallow window function expressions in queries that modify data.
Examples of what the OVER clause does can be seen in the postgres documentation.

Adding contains_over_clause = False to ExtraJoinRestriction allows the tests to run successfully.

closes #848

An update to django 4.2 has broken the test suite with error
AttributeError: 'ExtraJoinRestriction' object has no attribute 'contains_over_clause'

The `contains_over_clause = False` attribute added to ExtraJoinRestriction solves the error.
@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Merging #850 (9290566) into master (8dc5ab0) will decrease coverage by 2.39%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #850      +/-   ##
==========================================
- Coverage   95.81%   93.43%   -2.39%     
==========================================
  Files           3        9       +6     
  Lines         454      731     +277     
  Branches       96      131      +35     
==========================================
+ Hits          435      683     +248     
- Misses         12       31      +19     
- Partials        7       17      +10     
Impacted Files Coverage Δ
taggit/managers.py 96.20% <100.00%> (+0.01%) ⬆️

... and 6 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rtpg
Copy link
Contributor

rtpg commented May 4, 2023

Thank you for tracking this, I've integrated this in a separate PR based on this. Sorry for the wait

@rtpg rtpg closed this May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Django 4.2 test failures
2 participants