Skip to content

INTPYTHON-483 Add querying support for EmbeddedModelArrayField #303

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

Merged
merged 2 commits into from
Jun 4, 2025

Conversation

WaVEV
Copy link
Collaborator

@WaVEV WaVEV commented May 13, 2025

(initial review comments at timgraham#9)

@WaVEV WaVEV marked this pull request as draft May 13, 2025 17:23
@WaVEV WaVEV force-pushed the arrayfield+emf-querying branch from fc53f56 to c446c49 Compare May 14, 2025 02:07
@timgraham timgraham changed the title Arrayfield+emf querying Add querying support for EmbeddedModelArrayField May 16, 2025
@WaVEV WaVEV force-pushed the arrayfield+emf-querying branch 4 times, most recently from 9850b66 to f50337f Compare May 21, 2025 02:19
@WaVEV WaVEV force-pushed the arrayfield+emf-querying branch 6 times, most recently from 41f1843 to ca7a7b3 Compare May 26, 2025 03:33
@WaVEV WaVEV force-pushed the arrayfield+emf-querying branch 3 times, most recently from 744a9ef to f6625d9 Compare June 2, 2025 01:30
@timgraham timgraham changed the title Add querying support for EmbeddedModelArrayField INTPYTHON-483 Add querying support for EmbeddedModelArrayField Jun 2, 2025
@WaVEV WaVEV force-pushed the arrayfield+emf-querying branch 3 times, most recently from b4e627e to e40bea8 Compare June 3, 2025 00:05
@WaVEV WaVEV marked this pull request as ready for review June 3, 2025 00:06
@WaVEV WaVEV requested a review from timgraham June 3, 2025 00:09
@timgraham timgraham force-pushed the arrayfield+emf-querying branch from 26b63d9 to c97ef18 Compare June 3, 2025 15:01
@timgraham timgraham force-pushed the arrayfield+emf-querying branch 2 times, most recently from 4e5e57c to 5e66c91 Compare June 3, 2025 20:01
Otherwise, they collide with django.contrib.postgres's ArrayField.
@timgraham timgraham force-pushed the arrayfield+emf-querying branch from 5e66c91 to 13efcd1 Compare June 4, 2025 14:54
@timgraham timgraham merged commit 13efcd1 into mongodb:main Jun 4, 2025
15 checks passed
Comment on lines +255 to +263
def test_invalid_lookup(self):
msg = "Unsupported lookup 'return' for EmbeddedModelArrayField of 'IntegerField'"
with self.assertRaisesMessage(FieldDoesNotExist, msg):
Exhibit.objects.filter(sections__section_number__return=3)

def test_invalid_operation(self):
msg = "Unsupported lookup 'rage' for EmbeddedModelArrayField of 'IntegerField'"
with self.assertRaisesMessage(FieldDoesNotExist, msg):
Exhibit.objects.filter(sections__section_number__rage=[10])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the second test redundant?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wanted to test range, given that range is a numerical operation but isn't allowed in EmbeddedModelArrayField. So, It was a test to prove the lookups are only the allowed by the scalar type (in this case numeric) and the allowed by the EMAF. But Rage does not exist in both, there are other test with range but was over json

@mongodb mongodb deleted a comment from aclark4life Jul 3, 2025
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.

3 participants