#31936: JSONField not filtering correct with __in lookup on key transforms.
-------------------------------------+-------------------------------------
     Reporter:  Sébastien Pattyn     |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  3.1
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:  JSONField            |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * status:  new => closed
 * resolution:   => needsinfo


Comment:

 Thanks for this ticket, however I cannot reproduce this issue. I tried
 with the following test and it works for me (also on MySQL):
 {{{
 diff --git a/tests/model_fields/test_jsonfield.py
 b/tests/model_fields/test_jsonfield.py
 index a7648711ac..97d79e5bee 100644
 --- a/tests/model_fields/test_jsonfield.py
 +++ b/tests/model_fields/test_jsonfield.py
 @@ -608,6 +608,14 @@ class TestQuerying(TestCase):
              self.objs[3:5],
          )

 +    def test_31936(self):
 +        self.assertSequenceEqual(
 +            NullableJSONModel.objects.filter(
 +                value__c__in=[14, 15],
 +            ),
 +            [self.objs[3], self.objs[4]],
 +        )
 +
      @skipUnlessDBFeature('supports_json_field_contains')
      def test_array_key_contains(self):
          tests = [
 }}}

 Can you prepare a sample project to reproduce this issue? and provide
 details about database (specific version, MariaDB/MySQL)?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31936#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/075.14782ba32a686d4358ad1999dd2f631b%40djangoproject.com.

Reply via email to