summaryrefslogtreecommitdiff
path: root/tests/postgres_tests/test_array.py
AgeCommit message (Collapse)Author
2026-01-18Applied Black's 2026 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/26.1.0
2025-12-03Fixed #36280 -- Replaced exception checks with assertRaisesMessage().Skyiesac
2025-11-13Refs #31055 -- Adjusted passing of Field.check kwargs to ArrayField.base_field.Simon Charette
This was missed when Field.check(databases) was introduced.
2025-10-29Refs #35381 -- Deprecated using None in JSONExact rhs to mean JSON null.Clifford Gama
Key and index lookups are exempt from the deprecation. Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2025-10-29Refs #35381 -- Delegated ArrayField element prepping to ↵Clifford Gama
base_field.get_db_prep_save. Previously, ArrayField always used base_field.get_db_prep_value when saving, which could differ from how base_field prepares data for save. This change overrides ArrayField.get_db_prep_save to delegate to the base_field's get_db_prep_save, ensuring elements like None in JSONField arrays are saved correctly as SQL NULL instead of JSON null.
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-03-25Fixed #36276 -- Omitted size=None from ArrayField.deconstruct().Tim Graham
2025-01-20Fixed #36107 -- Adjusted UNNEST bulk_create strategy to opt-out sized arrays.Simon Charette
The array fields opt-out heuristic failed to account for sized arrays. Note that we keep relying on db_type as opposed to performing an ArrayField instance check against the column's field as there could be other implementations of model fields that use Postgres arrays to store the optimization must be disabled for all of them. Refs #35936. Thanks Claude Paroz for the report and test.
2024-12-13Fixed typo in ArrayField test name.Tim Graham
2024-12-05Fixed #35944 -- Handled serialization of Unicode values in ArrayField and ↵Oleg Sverdlov
HStoreField.
2024-10-07Fixed #35449 -- Fixed validation of array items in SplitArrayField when ↵GappleBee
remove_trailing_nulls=True.
2024-07-03Refs #28900 -- Made SELECT respect the order specified by values(*selected).Simon Charette
Previously the order was always extra_fields + model_fields + annotations with respective local ordering inferred from the insertion order of *selected. This commits introduces a new `Query.selected` propery that keeps tracks of the global select order as specified by on values assignment. This is crucial feature to allow the combination of queries mixing annotations and table references. It also allows the removal of the re-ordering shenanigans perform by ValuesListIterable in order to re-map the tuples returned from the database backend to the order specified by values_list() as they'll be in the right order at query compilation time. Refs #28553 as the initially reported issue that was only partially fixed for annotations by d6b6e5d0fd4e6b6d0183b4cf6e4bd4f9afc7bf67. Thanks Mariusz Felisiak and Sarah Boyce for review.
2023-12-30Fixed #29049 -- Added slicing notation to F expressions.Nick Pope
Co-authored-by: Priyansh Saxena <askpriyansh@gmail.com> Co-authored-by: Niclas Olofsson <n@niclasolofsson.se> Co-authored-by: David Smith <smithdc@gmail.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Abhinav Yadav <abhinav.sny.2002@gmail.com>
2023-12-12Fixed #34013 -- Added QuerySet.order_by() support for annotation transforms.Simon Charette
Thanks Eugene Morozov and Ben Nace for the reports.
2023-06-18Fixed #34662 -- Corrected number in error messages for ↵şuayip üzülmez
Array(Min/Max)LengthValidator.
2023-03-24Fixed #28553 -- Fixed annotation mismatch with ↵David Wobrock
QuerySet.values()/values_list() on compound queries. Co-authored-by: Matthias Kestenholz <mk@feinheit.ch>
2023-02-20Fixed #34346 -- Ordered selected expressions by position.Simon Charette
Used the same approach as for #34176 by using selected expressions position to prevent ambiguous aliases in collisions. Thanks henribru for the report. Regression in 04518e310d4552ff7595a34f5a7f93487d78a406.
2023-02-01Refs #33476 -- Applied Black's 2023 stable style.David Smith
Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
2023-01-09Fixed #34176 -- Fixed grouping by ambiguous aliases.Simon Charette
Regression in b7b28c7c189615543218e81319473888bc46d831. Refs #31377. Thanks Shai Berger for the report and reviews. test_aggregation_subquery_annotation_values_collision() has been updated as queries that are explicitly grouped by a subquery should always be grouped by it and not its outer columns even if its alias collides with referenced table columns. This was not possible to accomplish at the time 10866a10 landed because we didn't have compiler level handling of colliding aliases.
2022-12-28Fixed #14094 -- Added support for unlimited CharField on PostgreSQL.Adrian Torres
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-12-15Fixed #33308 -- Added support for psycopg version 3.Daniele Varrazzo
Thanks Simon Charette, Tim Graham, and Adam Johnson for reviews. Co-authored-by: Florian Apolloner <florian@apolloner.eu> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-12-12Refs #33308 -- Moved psycopg2 imports to the psycopg_any module.Florian Apolloner
2022-12-01Refs #33308 -- Ensured type handlers are registered for all PostgreSQL ↵Florian Apolloner
specific tests. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-11-18Fixed #26056 -- Added QuerySet.values()/values_list() support for ↵Ben Cail
ArrayField's __overlap lookup. Thanks Mads Jensen and kosz85 and the initial patch.
2022-11-03Fixed #34080 -- Fixed __exact lookup when nested arrays contain only NULL ↵Ion Alberdi
values. Thanks jerch and David Sanders for reviews.
2022-11-03Refs #34080 -- Added tests for __exact lookup when non-nested arrays contain ↵Ion Alberdi
only NULL values.
2022-10-07Removed hardcoded pks in TestQuerying.test_group_by_order_by_aliases test.Mariusz Felisiak
2022-10-06Refs #33308 -- Enabled explicit GROUP BY and ORDER BY aliases.Simon Charette
This ensures explicit grouping from using values() before annotating an aggregate function groups by selected aliases if supported. The GROUP BY feature is disabled on Oracle because it doesn't support it.
2022-08-23Fixed #33927 -- Fixed crash when displaying ArrayField with choices in admin.David Wobrock
2022-05-17Refs #32339 -- Deprecated default.html form template.David Smith
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2022-02-22Removed redundant QuerySet.all() calls in docs and tests.Nick Pope
Most QuerySet methods are mapped onto the Manager and, in general, it isn't necessary to call .all() on the manager.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-12-22Refs #32355 -- Bumped required psycopg2 version to 2.8.4.Mariusz Felisiak
psycopg2 2.8.4 is the first release to support Python 3.8.
2021-07-06Fixed #32776 -- Added support for Array subqueries on PostgreSQL.Hannes Ljungberg
2020-12-03Refs #27095 -- Fixed test_contained_by_including_F_object when run in reverse.Mariusz Felisiak
Tests should not rely on auto PKs. Test regression in 33403bf80f635577a18426bc99c8a65e31fd8dfa.
2020-11-27Fixed #25534, Fixed #31639 -- Added support for transform references in ↵Ian Foote
expressions. Thanks Mariusz Felisiak and Simon Charette for reviews.
2020-11-26Refs #27095 -- Allowed (non-nested) arrays containing expressions for ↵Hannes Ljungberg
ArrayField lookups.
2020-11-26Added test for ArrayField's __contains lookup with subqueries.Hannes Ljungberg
2020-07-30Bumped minimum isort version to 5.1.0.David Smith
Fixed inner imports per isort 5. isort 5.0.0 to 5.1.0 was unstable.
2020-06-24Defined output_field of Func() in ↵Simon Charette
test_grouping_by_annotations_with_array_field_param(). output_field cannot be automatically determined because the first argument passed to ARRAY_LEN is an ArrayField and the second one is an integer.
2019-12-10Fixed #31073 -- Prevented CheckboxInput.get_context() from mutating attrs.Peter Andersen
2019-11-08Fixed #24858 -- Added support for get_FOO_display() to ArrayField and ↵Hasan Ramezani
RangeFields. _get_FIELD_display() crashed when Field.choices was unhashable.
2019-11-05Fixed #30095 -- Fixed system check for RangeField/ArrayField.choices with ↵Hasan Ramezani
lists and tuples.
2019-11-01Refs #27808 -- Added test for saving nested ArrayField with nullable base field.Hasan Ramezani
2019-10-28Fixed #30907 -- Fixed SplitArrayField.has_changed() with removal of empty ↵Pavel Dedik
trailing values.
2019-10-28Refs #30907 -- Added more tests for SplitArrayField.has_changed().Pavel Dedik
2019-10-17Refs #12990 -- Moved CheckFieldDefaultMixin to the ↵sage
django.db.models.fields.mixins.
2019-08-23Fixed #30715 -- Fixed crash of ArrayField lookups on ArrayAgg annotations ↵Mariusz Felisiak
over AutoField.
2019-08-05Added tests for using ArrayField's IndexTransform/SliceTransform on ↵Mariusz Felisiak
expressions with params.