#30971 closed Bug (fixed)
Query.resolve_lookup_value coerces value of type list to tuple
| Reported by: | George Marshall | Owned by: | George Marshall |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 3.0 |
| Severity: | Release blocker | Keywords: | |
| Cc: | Simon Charette | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Changes introduced in #30687 cause an input value list to be coerced to tuple breaking exact value queries. This affects ORM field types that are dependent on matching input types such as PickledField.
The expected iterable return type should match input iterable type.
Change History (9)
comment:1 by , 6 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 6 years ago
| Has patch: | set |
|---|
comment:3 by , 6 years ago
| Severity: | Normal → Release blocker |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
Thanks. I agree that we shouldn't change iterable types unless absolutely necessary to avoid these subtle bugs.
comment:4 by , 6 years ago
| Needs tests: | set |
|---|
comment:5 by , 6 years ago
| Cc: | added |
|---|
comment:7 by , 6 years ago
| Needs tests: | unset |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
Note:
See TracTickets
for help on using tickets.
PR: https://github.com/django/django/pull/12050
This could potentially use a test case, need some direction on how to cover this.
I have also included links to my Django library code that was affected by the change.
https://github.com/georgemarshall/django-cryptography/blob/789e7a757e01220bc46b17b995bb201cda496ef6/tests/fields/test_pickle.py#L61
https://travis-ci.org/georgemarshall/django-cryptography/jobs/609869188
I am also not sure how the postgres
ArrayFieldwas not affected by the tuple coercion.