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

Fixed #35002 -- Made UniqueConstraints with fields respect nulls_distinct. #17567

Merged
merged 1 commit into from
Dec 3, 2023

Conversation

peterthomassen
Copy link
Contributor

No description provided.

tests/schema/tests.py Outdated Show resolved Hide resolved
@charettes
Copy link
Member

Thanks for the patch @peterthomassen! Could you re-submit your changes against the main branch instead?

We appreciate the attention but mergers will take care to backport to 5.x, which they have already a process defined for, as opposed to forward porting to main.

@peterthomassen peterthomassen changed the base branch from stable/5.0.x to main December 1, 2023 20:00
@peterthomassen
Copy link
Contributor Author

Done.

@charettes Thanks, I didn't know. I had read up on it before I pushed, and the docs say that when "working for a fix on the 1.4 branch", one would base off stable/1.4.x. That implied to me that I should start from the stable/5.0.x branch.

Copy link
Member

@charettes charettes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the target adjustment and the quick patch @peterthomassen!

I think we can do without the second test given test_unique_constraint_nulls_distinct_unsupported already covers this code path here.

I think that the patch is in a good enough shape to have mergers eyes on it at this point. I suspect we'll want to rename test_unique_constraint_nulls_distinct to test_unique_constraint_index_nulls_distinct and your one test_unique_constraint_nulls_distinct but we'll see what they'll think!

tests/schema/tests.py Outdated Show resolved Hide resolved
tests/schema/tests.py Outdated Show resolved Hide resolved
tests/schema/tests.py Outdated Show resolved Hide resolved
@charettes
Copy link
Member

the docs say that when "working for a fix on the 1.4 branch", one would base off stable/1.4.x. That implied to me that I should start from the stable/5.0.x branch.

That's interesting, that would explain why we've seen similar submission in the past. I wonder if we'd want to nuance the suggestion to mention that if the bug is still present in main you likely want to base of that instead.

@peterthomassen
Copy link
Contributor Author

I think that the patch is in a good enough shape to have mergers eyes on it at this point.

Ok, I take it that this means you folks are going to make any subsequent changes, so I can go off for dinner. :)

I suspect we'll want to rename test_unique_constraint_nulls_distinct to test_unique_constraint_index_nulls_distinct and your one test_unique_constraint_nulls_distinct but we'll see what they'll think!

I like that!

@felixxm felixxm self-assigned this Dec 1, 2023
@felixxm felixxm changed the title Fixed #35002 -- Honor nulls_distinct for multi-column unique constraint Fixed #35002 -- Made UniqueConstraints with fields respect nulls_distinct. Dec 3, 2023
@felixxm
Copy link
Member

felixxm commented Dec 3, 2023

@peterthomassen Thanks 👍 Welcome aboard ⛵

@felixxm felixxm merged commit 54cb1a7 into django:main Dec 3, 2023
38 checks passed
@peterthomassen peterthomassen deleted the 20231201_nulls_distinct branch December 3, 2023 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants