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 an issue when filtering on list of floats with not empty #2813

Closed
wants to merge 2 commits into from

Conversation

razbamnolker
Copy link

    class Family(Document):
        ages = ListField(field=FloatField())

when filtering with family.objects(ages__gt=[]) mongoengine raised an error ( This does not happen with list of undeclared fields)
This PR fix this issue.


Family(ages = [7.5, 5.5, 29.5, 32.7]).save()
Family(ages = []).save()
assert Family.objects(ages__gt=[]).count() == 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Further to the comment made in the associated Issue, which one are you expecting to match here? [] or [7.5, 5.5, 29.5, 32.7] ? I believe it's [7.5, 5.5, 29.5, 32.7] but the test case is ambiguous

@bagerard
Copy link
Collaborator

#2828 implements the full support for using list with gt, lt, gte, lte and ne

@bagerard bagerard closed this Aug 17, 2024
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.

2 participants