@@ -75,6 +75,10 @@ def introspected_field_types(self):
75
75
'virtual' : None ,
76
76
}
77
77
78
+ @cached_property
79
+ def is_cockroachdb_23_2 (self ):
80
+ return self .connection .cockroachdb_version >= (23 , 2 )
81
+
78
82
@cached_property
79
83
def django_test_expected_failures (self ):
80
84
expected_failures = super ().django_test_expected_failures
@@ -154,19 +158,6 @@ def django_test_expected_failures(self):
154
158
'many_to_one.tests.ManyToOneTests.test_get_prefetch_querysets_reverse_invalid_querysets_length' ,
155
159
'migrations.test_operations.OperationTests.test_smallfield_autofield_foreignfield_growth' ,
156
160
'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' ,
170
161
# unexpected unique index in pg_constraint query:
171
162
# https://github.com/cockroachdb/cockroach/issues/61098
172
163
'introspection.tests.IntrospectionTests.test_get_constraints_unique_indexes_orders' ,
@@ -182,13 +173,29 @@ def django_test_expected_failures(self):
182
173
# <int> * <int> (desired <decimal>):
183
174
# https://github.com/cockroachdb/cockroach/issues/73587
184
175
'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' ,
189
176
# ProgrammingError: VALUES types int and float cannot be matched
190
177
'field_defaults.tests.DefaultTests.test_bulk_create_mixed_db_defaults_function' ,
191
178
})
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
+ })
192
199
if self .uses_server_side_binding :
193
200
expected_failures .update ({
194
201
# could not determine data type of placeholder:
0 commit comments