Skip to content

Commit ef465e1

Browse files
committed
confirm support for CockroachDB 23.2
1 parent aaf42d1 commit ef465e1

File tree

4 files changed

+39
-18
lines changed

4 files changed

+39
-18
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ jobs:
3939
use_psycopg2: psycopg2
4040
- crdb-version: v23.1.11
4141
use_server_side_binding: server_side_binding
42+
- crdb-version: v23.2.0
43+
- crdb-version: v23.2.0
44+
use_psycopg2: psycopg2
45+
- crdb-version: v23.2.0
46+
use_server_side_binding: server_side_binding
4247
# Uncomment to enable testing of CockroachDB nightly.
4348
#- crdb-version: LATEST
4449
#- crdb-version: LATEST

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 5.0.1 - Unreleased
4+
5+
- Confirm support for CockroachDB 23.2.x (no code changes required), which adds
6+
support for ordering by JSON.
7+
38
## 5.0 - 2023-12-11
49

510
Initial release for Django 5.0.x and CockroachDB 22.2.x and 23.1.x.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ By default, CockroachDB sends the version of django-cockroachdb that you're
9292
using back to Cockroach Labs. To disable this, set
9393
`DISABLE_COCKROACHDB_TELEMETRY = True` in your Django settings.
9494

95-
## Known issues and limitations in CockroachDB 23.1.x and earlier
95+
## Known issues and limitations in CockroachDB 23.2.x and earlier
9696

9797
- CockroachDB [can't disable constraint checking](https://github.com/cockroachdb/cockroach/issues/19444),
9898
which means certain things in Django like forward references in fixtures
@@ -144,3 +144,7 @@ using back to Cockroach Labs. To disable this, set
144144
- [overlaps_left (&<), overlaps_right (&>), overlaps_above (&<|),
145145
overlaps_below (&>|)](https://github.com/cockroachdb/cockroach/issues/57098)
146146
- [strictly_above (|>>), strictly_below (<<|)](https://github.com/cockroachdb/cockroach/issues/57095)
147+
148+
## Known issues and limitations in CockroachDB 23.1.x and earlier
149+
150+
- CockroachDB doesn't support by ordering by JSON.

django_cockroachdb/features.py

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ def introspected_field_types(self):
7575
'virtual': None,
7676
}
7777

78+
@cached_property
79+
def is_cockroachdb_23_2(self):
80+
return self.connection.cockroachdb_version >= (23, 2)
81+
7882
@cached_property
7983
def django_test_expected_failures(self):
8084
expected_failures = super().django_test_expected_failures
@@ -154,19 +158,6 @@ def django_test_expected_failures(self):
154158
'many_to_one.tests.ManyToOneTests.test_get_prefetch_querysets_reverse_invalid_querysets_length',
155159
'migrations.test_operations.OperationTests.test_smallfield_autofield_foreignfield_growth',
156160
'migrations.test_operations.OperationTests.test_smallfield_bigautofield_foreignfield_growth',
157-
# unsupported comparison operator: <jsonb> > <string>:
158-
# https://github.com/cockroachdb/cockroach/issues/49144
159-
'model_fields.test_jsonfield.TestQuerying.test_deep_lookup_transform',
160-
# ordering by JSON isn't supported:
161-
# https://github.com/cockroachdb/cockroach/issues/35706
162-
'expressions_window.tests.WindowFunctionTests.test_key_transform',
163-
'model_fields.test_jsonfield.TestQuerying.test_deep_distinct',
164-
'model_fields.test_jsonfield.TestQuerying.test_order_grouping_custom_decoder',
165-
'model_fields.test_jsonfield.TestQuerying.test_ordering_by_transform',
166-
'model_fields.test_jsonfield.TestQuerying.test_ordering_grouping_by_key_transform',
167-
# cannot index a json element:
168-
# https://github.com/cockroachdb/cockroach/issues/35706
169-
'schema.tests.SchemaTests.test_func_index_json_key_transform',
170161
# unexpected unique index in pg_constraint query:
171162
# https://github.com/cockroachdb/cockroach/issues/61098
172163
'introspection.tests.IntrospectionTests.test_get_constraints_unique_indexes_orders',
@@ -182,13 +173,29 @@ def django_test_expected_failures(self):
182173
# <int> * <int> (desired <decimal>):
183174
# https://github.com/cockroachdb/cockroach/issues/73587
184175
'aggregation.tests.AggregateTestCase.test_aggregation_default_expression',
185-
# DataError: incompatible COALESCE expressions: expected pi() to be
186-
# of type decimal, found type float
187-
# https://github.com/cockroachdb/cockroach/issues/73587#issuecomment-988408190
188-
'aggregation.tests.AggregateTestCase.test_aggregation_default_using_decimal_from_database',
189176
# ProgrammingError: VALUES types int and float cannot be matched
190177
'field_defaults.tests.DefaultTests.test_bulk_create_mixed_db_defaults_function',
191178
})
179+
if not self.is_cockroachdb_23_2:
180+
expected_failures.update({
181+
# cannot index a json element:
182+
# https://github.com/cockroachdb/cockroach/issues/35706
183+
'schema.tests.SchemaTests.test_func_index_json_key_transform',
184+
# ordering by JSON isn't supported:
185+
# https://github.com/cockroachdb/cockroach/issues/35706
186+
'expressions_window.tests.WindowFunctionTests.test_key_transform',
187+
'model_fields.test_jsonfield.TestQuerying.test_deep_distinct',
188+
'model_fields.test_jsonfield.TestQuerying.test_order_grouping_custom_decoder',
189+
'model_fields.test_jsonfield.TestQuerying.test_ordering_by_transform',
190+
'model_fields.test_jsonfield.TestQuerying.test_ordering_grouping_by_key_transform',
191+
# unsupported comparison operator: <jsonb> > <string>:
192+
# https://github.com/cockroachdb/cockroach/issues/49144
193+
'model_fields.test_jsonfield.TestQuerying.test_deep_lookup_transform',
194+
# DataError: incompatible COALESCE expressions: expected pi() to be
195+
# of type decimal, found type float
196+
# https://github.com/cockroachdb/cockroach/issues/73587#issuecomment-988408190
197+
'aggregation.tests.AggregateTestCase.test_aggregation_default_using_decimal_from_database',
198+
})
192199
if self.uses_server_side_binding:
193200
expected_failures.update({
194201
# could not determine data type of placeholder:

0 commit comments

Comments
 (0)