Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-05-22 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:
 |  HeejunShin
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by HeejunShin):

 i have a question.
 maybe The bug reproduction seems to be incorrect.

 i tested using 2 ways.

 {{{
 tests[1].json = {"test": Cast('good', output_field=CharField())}
 Test.objects.bulk_update(tests_will_be_updated, fields=["json"])
 }}}

 {{{
 tests[1].json = Cast("good", output_field=CharField())
 Test.objects.bulk_update(tests_will_be_updated, fields=["json"])
 }}}

 first one, i got  "raise TypeError(f'Object of type {o.__class__.__name__}
 'TypeError: Object of type Cast is not JSON serializable" error.
 but value argument type in get_db_prep_value is dict.

 second one, i could not get error.
 value argument type in get_db_prep_value is . (CASE WHEN  THEN Cast(Col(polls_test,
 polls.Test.json)), ELSE Value(None)).

 i thought first one is type dict, so this is wrong.
 is second one wrong way that reproduce bug case?
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018fa17fdf9a-499173ea-9027-44ff-b6a1-0a6dd6ac09d1-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-05-17 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:
 |  HeejunShin
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by HeejunShin):

 It's really late though
 I was just analyzing the code and reproduced the bug.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f8787c6b2-09bcd139-9942-42cd-a96b-0a6280309498-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-04-20 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:
 |  HeejunShin
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by HeejunShin):

 Replying to [comment:23 Natalia Bidart]:
 > Hello HeejunShin, thank you for asking! You can take the time you need
 to work on this ticket, in general no ticket is urgent unless is a release
 blocker, which is not the case for this one.
 > Also, if you can't work on this anymore, that is also fine and you can
 just de-assign yourself from the ticket and eventually someone else would
 pick it up.
 >
 > Django is built and maintained by its community and everyone contributes
 their time and energy when they can.


 thank you for your response.
 I'll try my best.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018efead8700-1babd4a4-18d1-4b9b-a323-f12a84115356-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-04-19 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:
 |  HeejunShin
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Natalia Bidart):

 Hello HeejunShin, thank you for asking! You can take the time you need to
 work on this ticket, in general no ticket is urgent unless is a release
 blocker, which is not the case for this one.
 Also, if you can't work on this anymore, that is also fine and you can
 just de-assign yourself from the ticket and eventually someone else would
 pick it up.

 Django is built and maintained by its community and everyone contributes
 their time and energy when they can.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ef646cc67-257a8178-5fbc-48c5-b6ab-797347a0b804-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-04-17 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:
 |  HeejunShin
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by HeejunShin):

 Replying to [comment:21 Natalia Bidart]:
 > Ticket #35381 is related to this.

 Is this a problem that needs to be resolved as quickly as possible?
 Should I also refer to the ticket you mentioned to solve the problem?
 Any advice would be greatly appreciated.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018eee9286ee-235dcfce-b40b-42e1-a06b-191766dc50f4-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-04-17 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:
 |  HeejunShin
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Natalia Bidart):

 Ticket #35381 is related to this.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018eed43824d-8d91d1a9-f74d-4b7b-8e0a-33da8339387b-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-04-16 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:
 |  HeejunShin
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by HeejunShin):

 Sorry for the slow progress. I am currently analyzing the code looking at
 the customizing doc of the Field class.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ee7385dfe-300c0fad-d134-49b2-95b3-2634f95c2916-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-04-02 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:
 |  HeejunShin
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by HeejunShin):

 Replying to [comment:15 Simon Charette]:

 thank you for  youre response.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ea25d659d-c1f6f1e3-b099-48ff-9fcc-fee0d09436ed-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-04-02 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:
 |  HeejunShin
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by HeejunShin):

 * owner:  (none) => HeejunShin
 * status:  new => assigned

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ea25cdc4e-899362f9-432a-496b-946f-7311e84684bc-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-04-02 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by HeejunShin):

 Thank you for  youre response.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ea25c1b2d-5e4e2a78-d7de-4bb0-83e2-352a042928b5-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-04-02 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by HeejunShin):

 Replying to [comment:15 Simon Charette]:
 > Replying to [comment:14 HeejunShin]:
 > > Is this ticket solved?
 >
 > No. While it has an inline tentative patch no one
 [https://docs.djangoproject.com/en/5.0/internals/contributing/writing-code
 /submitting-patches/#claiming-tickets has opened a PR on Github with the
 proposed changes] including a regression test yet.

 > thank you for  youre response.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ea25adf9f-b79d8b2f-b536-4910-a123-10fe43719e25-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-03-28 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Simon Charette):

 Replying to [comment:14 HeejunShin]:
 > Is this ticket solved?

 No. While it has an inline tentative patch no one
 [https://docs.djangoproject.com/en/5.0/internals/contributing/writing-code
 /submitting-patches/#claiming-tickets has opened a PR on Github with the
 proposed changes] including a regression test yet.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e86adcc12-e7b9506c-6215-4f1b-bd26-a87eacf05640-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-03-27 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by HeejunShin):

 Is this ticket solved?
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e81c29925-4adecc33-015b-4f85-a632-201b87cbfba3-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-03-06 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Almaz):

 * owner:  Almaz => (none)
 * status:  assigned => new

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e13d05409-8bfa3cd8-1ea4-4826-99a3-afa826f4dd3f-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-03-06 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  Almaz
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Almaz):

 Is this a relevant problem?

 Because, after some period of exploration, I see that most of the code
 were updated.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e13d01fde-e5781091-fdd5-4c25-ba9e-e47e3df41a05-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-03-01 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  Almaz
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Almaz):

 * owner:  nobody => Almaz
 * status:  new => assigned

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018dfa561de7-fe00da77-c3cf-41d3-9f54-606f05cbfaaf-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-03-01 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by bcail):

 @HeejunShin, nobody owns this ticket, so you're welcome to work on this
 ticket. You can assign it to yourself and/or add comments as you work on
 it.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018dfa4910ef-48884caf-cb43-4ffa-9268-a55b108e89a9-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types

2024-02-24 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by HeejunShin):

  Could i try this ticket?
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ddce5fb32-226b9b33-6d5b-4177-9f83-0a245504bd29-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONField get_db_prep_value being called with `Cast` types (was: JSONFIeld get_db_prep_value being called with `Cast` types)

2024-02-14 Thread Django
#35167: JSONField get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Jacob Walls):

 * cc: Jacob Walls (added)
 * summary:  JSONFIeld get_db_prep_value being called with `Cast` types =>
 JSONField get_db_prep_value being called with `Cast` types

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018da84fb5bb-c7ccad51-4a55-49e3-b362-195e669b806e-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONFIeld get_db_prep_value being called with `Cast` types

2024-02-13 Thread Django
#35167: JSONFIeld get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Krish):

 * cc: Krish (added)

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018da1dadfc4-b7793eac-be3e-4cd7-b21c-bed38ae26b43-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONFIeld get_db_prep_value being called with `Cast` types

2024-02-07 Thread Django
#35167: JSONFIeld get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Simon Charette):

 > Any idea if this will make it to a 4.2 patch or will we need to upgrade
 to ~5?

 Assuming someone prepares a patch it should make the cut for 5.1 meant to
 be released in August 2024. It won't be backported to 4.2 or 5.0 at this
 point unfortunately.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018d86d86811-94ef27b6-e565-4ed7-9487-512dcb11ef6a-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONFIeld get_db_prep_value being called with `Cast` types

2024-02-07 Thread Django
#35167: JSONFIeld get_db_prep_value being called with `Cast` types
-+-
 Reporter:  Samantha Hughes  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Jacob Walls):

 * owner:  (none) => nobody
 * component:  Error reporting => Database layer (models, ORM)

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018d86d5866b-27805ced-0730-4ccf-bd2c-d0f136f8f207-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONFIeld get_db_prep_value being called with `Cast` types

2024-02-06 Thread Django
#35167: JSONFIeld get_db_prep_value being called with `Cast` types
-+
 Reporter:  Samantha Hughes  |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Error reporting  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Comment (by Samantha Hughes):

 Thanks, the quick response is really appreciated. Any idea if this will
 make it to a 4.2 patch or will we need to upgrade to ~5?
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018d7fd637a5-37fec560-4014-4fbb-b793-985f9d96e489-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONFIeld get_db_prep_value being called with `Cast` types

2024-02-05 Thread Django
#35167: JSONFIeld get_db_prep_value being called with `Cast` types
-+
 Reporter:  shughes-uk   |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Error reporting  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by Simon Charette):

 * cc: Simon Charette (added)

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018d7c9f6421-84bcb6d4-a153-4a01-80d7-1de10c751bfe-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONFIeld get_db_prep_value being called with `Cast` types

2024-02-05 Thread Django
#35167: JSONFIeld get_db_prep_value being called with `Cast` types
-+
 Reporter:  Samantha Hughes  |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Error reporting  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Comment (by Simon Charette):

 You mentioned that you are using Django 4.2 so the following patch won't
 apply cleanly against your branch but against main it gets the tests
 passing

 {{{#!diff
 diff --git a/django/db/models/fields/json.py
 b/django/db/models/fields/json.py
 index 571e6e79f3..73b4a4dd50 100644
 --- a/django/db/models/fields/json.py
 +++ b/django/db/models/fields/json.py
 @@ -99,18 +99,23 @@ def get_internal_type(self):
  def get_db_prep_value(self, value, connection, prepared=False):
  if not prepared:
  value = self.get_prep_value(value)
 -if isinstance(value, expressions.Value) and isinstance(
 -value.output_field, JSONField
 -):
 -value = value.value
 -elif hasattr(value, "as_sql"):
 -return value
  return connection.ops.adapt_json_value(value, self.encoder)

  def get_db_prep_save(self, value, connection):
 +# This slightly convoluted logic is to allow for `None` to be
 used to
 +# store SQL `NULL` while `Value(None, JSONField())` can be used
 to
 +# store JSON `null` while preventing compilable `as_sql` values
 from
 +# making their way to `get_db_prep_value` which is what the
 `super()`
 +# implementation does.
  if value is None:
  return value
 -return self.get_db_prep_value(value, connection)
 +elif (
 +isinstance(value, expressions.Value)
 +and value.value is None
 +and isinstance(value.output_field, JSONField)
 +):
 +value = None
 +return super().get_db_prep_save(value, connection)

  def get_transform(self, name):
  transform = super().get_transform(name)
 }}}

 Basically now that the deprecation shims have been removed the logic can
 be slightly simplified to only have to special case the `Value(None,
 JSONField())` which is truly the only problematic case in the
 implementation of `JSONField` due to ambiguous nature of `None` with
 regards to SQL `NULL` and JSON `null`.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018d7c9d2f39-246340ce-af48-4156-a2df-f60361f10c90-00%40eu-central-1.amazonses.com.


Re: [Django] #35167: JSONFIeld get_db_prep_value being called with `Cast` types

2024-02-05 Thread Django
#35167: JSONFIeld get_db_prep_value being called with `Cast` types
-+
 Reporter:  Samantha Hughes  |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Error reporting  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:  JSONField| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by Simon Charette):

 * type:  Uncategorized => Bug
 * stage:  Unreviewed => Accepted

Comment:

 This highly likely relates to #34539 which was about making sure
 `get_db_prep_value` **always** calls `get_prep_value` as it use to be case
 in 4.1.

 Given the default implementation of `get_db_prep_save` doesn't delegate to
 `get_db_prep_value`
 
[https://github.com/django/django/blob/9cefdfc43f0bae696b56fa5a0bf22346f85a/django/db/models/fields/__init__.py#L1012-L1013
 when provided a compilable expression] I believe we should also make sure
 `JSONField.get_db_prep_save` does something equivalent.

 The challenge here is that `Value(output_field=JSONField())`, which
 represents wrapped literal JSON values which could also be JSON strings,
 must be able to make their way to `connection.ops.adapt_json_value(value,
 self.encoder)`. At least they needed during the deprecation period maybe
 it's no longer the case since `Value(value).as_sql` will do the right
 thing by itself.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018d7c718193-e0246539-c3aa-486e-bb88-1038c4e239ce-00%40eu-central-1.amazonses.com.


[Django] #35167: JSONFIeld get_db_prep_value being called with `Cast` types

2024-02-05 Thread Django
#35167: JSONFIeld get_db_prep_value being called with `Cast` types
---+---
   Reporter:  shughes-uk   |  Owner:  (none)
   Type:  Uncategorized| Status:  new
  Component:  Error reporting  |Version:  4.2
   Severity:  Normal   |   Keywords:  JSONField
   Triage Stage:  Unreviewed   |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
  UI/UX:  0|
---+---
 Running django 4.2.9.

 We have a customized version of the standard `JsonField` where we have
 overridden `from_db_value` and `get_prep_value`.

 The worked in django ~4.1. Migrating to 4.2.9, the `get_prep_value`
 function started receiving `Cast` objects as the `value`, exploding json
 serializing/encryption , only during `bulk_update`.

 We fixed it by overriding `get_db_prep_save to



 {{{
 def get_db_prep_save(self, value, connection):
  if hasattr(value, "as_sql"):
  return value
  return self.get_db_prep_value(value, connection=connection,
 prepared=False)
 }}}


 The jsonfield implementation does not check for `as_sql`. I'm not sure if
 this is intentional or not (unmodified JSONField columns don't seem to
 explode), possibly our implementation has messed up the jsonfield?
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018d7c18377a-13ce5ff9-c6ba-4b21-9781-467aa45d8e53-00%40eu-central-1.amazonses.com.