Skip to content

Commit

Permalink
confirm support for CockroachDB 24.3
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Dec 4, 2024
1 parent 2f19aa6 commit af5d6e3
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
use_psycopg2: psycopg2
- crdb-version: v24.2.3
use_server_side_binding: server_side_binding
- crdb-version: v24.3.0
- crdb-version: v24.3.0
use_psycopg2: psycopg2
- crdb-version: v24.3.0
use_server_side_binding: server_side_binding
# Uncomment to enable testing of CockroachDB nightly.
#- crdb-version: LATEST
#- crdb-version: LATEST
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## 5.1.1 - Unreleased

- Confirmed support for CockroachDB 24.2.x (no code changes required).
- Confirmed support for CockroachDB 24.2.x and 24.3.x (no code changes
required).

## 5.1 - 2024-08-13

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ By default, CockroachDB sends the version of django-cockroachdb that you're
using back to Cockroach Labs. To disable this, set
`DISABLE_COCKROACHDB_TELEMETRY = True` in your Django settings.

## Known issues and limitations in CockroachDB 24.2.x and earlier
## Known issues and limitations in CockroachDB 24.3.x and earlier

- CockroachDB [can't disable constraint checking](https://github.com/cockroachdb/cockroach/issues/19444),
which means certain things in Django like forward references in fixtures
Expand Down
39 changes: 31 additions & 8 deletions django_cockroachdb/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def is_cockroachdb_23_2(self):
def is_cockroachdb_24_1(self):
return self.connection.cockroachdb_version >= (24, 1)

@cached_property
def is_cockroachdb_24_3(self):
return self.connection.cockroachdb_version >= (24, 3)

@cached_property
def django_test_expected_failures(self):
expected_failures = super().django_test_expected_failures
Expand Down Expand Up @@ -136,15 +140,11 @@ def django_test_expected_failures(self):
'migrations.test_operations.OperationTests.test_alter_field_pk_fk',
'migrations.test_operations.OperationTests.test_alter_field_pk_fk_char_to_int',
'migrations.test_operations.OperationTests.test_alter_field_pk_fk_db_collation',
'migrations.test_operations.OperationTests.test_alter_field_reloads_state_on_fk_target_changes',
'migrations.test_operations.OperationTests.test_alter_field_reloads_state_fk_with_to_field_related_name_target_type_change', # noqa
'migrations.test_operations.OperationTests.test_alter_field_reloads_state_on_fk_with_to_field_target_changes', # noqa
'migrations.test_operations.OperationTests.test_alter_field_reloads_state_on_fk_with_to_field_target_type_change', # noqa
'migrations.test_operations.OperationTests.test_rename_field_reloads_state_on_fk_target_changes',
'schema.tests.SchemaTests.test_alter_auto_field_to_char_field',
'schema.tests.SchemaTests.test_alter_autofield_pk_to_smallautofield_pk',
'schema.tests.SchemaTests.test_alter_primary_key_db_collation',
'schema.tests.SchemaTests.test_alter_primary_key_the_same_name',
'schema.tests.SchemaTests.test_char_field_pk_to_auto_field',
'schema.tests.SchemaTests.test_char_field_with_db_index_to_fk',
'schema.tests.SchemaTests.test_text_field_with_db_index_to_fk',
Expand Down Expand Up @@ -182,11 +182,21 @@ def django_test_expected_failures(self):
'aggregation.tests.AggregateTestCase.test_aggregation_default_expression',
# ProgrammingError: VALUES types int and float cannot be matched
'field_defaults.tests.DefaultTests.test_bulk_create_mixed_db_defaults_function',
# concat(): unknown signature: concat(string, int2) (desired <string>)
'db_functions.text.test_concat.ConcatTests.test_concat_non_str',
# unknown signature: concat(varchar, int) (returning <string>)
'migrations.test_operations.OperationTests.test_add_generate_field',
})
if not self.is_cockroachdb_24_3:
expected_failures.update({
# ALTER COLUMN TYPE requiring rewrite of on-disk data is currently
# not supported for columns that are part of an index.
# https://go.crdb.dev/issue/47636
'schema.tests.SchemaTests.test_alter_primary_key_the_same_name',
'migrations.test_operations.OperationTests.test_alter_field_reloads_state_on_fk_target_changes',
'migrations.test_operations.OperationTests.test_alter_field_reloads_state_on_fk_with_to_field_target_changes', # noqa
'migrations.test_operations.OperationTests.test_rename_field_reloads_state_on_fk_target_changes',
# unknown signature: concat(varchar, int) (returning <string>)
'migrations.test_operations.OperationTests.test_add_generate_field',
# concat(): unknown signature: concat(string, int2) (desired <string>)
'db_functions.text.test_concat.ConcatTests.test_concat_non_str',
})
if not self.is_cockroachdb_23_2:
expected_failures.update({
# cannot index a json element:
Expand Down Expand Up @@ -258,6 +268,10 @@ def django_test_expected_failures(self):
'queries.test_bulk_update.BulkUpdateTests.test_updated_rows_when_passing_duplicates',
'queries.test_q.QCheckTests.test_expression',
'queries.test_qs_combinators.QuerySetSetOperationTests.test_union_multiple_models_with_values_list_and_annotations', # noqa
# error in argument for $2: could not parse ":" as type int2:
# strconv.ParseInt: parsing ":": invalid syntax
# https://github.com/cockroachdb/cockroach/issues/136295
'db_functions.text.test_concat.ConcatTests.test_concat_non_str',
# unsupported binary operator: <interval> / <decimal>
'expressions.tests.FTimeDeltaTests.test_durationfield_multiply_divide',
# InvalidParameterValue: unsupported binary operator: <int4> / <float>
Expand All @@ -268,6 +282,15 @@ def django_test_expected_failures(self):
# operator: <decimal> / <float> (desired <decimal>)
'aggregation.tests.AggregateTestCase.test_aggregation_default_passed_another_aggregate',
})
if self.is_cockroachdb_24_3:
expected_failures.update({
# psycopg.errors.IndeterminateDatatype: replace():
# replace(): replace(): concat(): could not determine data
# type of placeholder $3. This worked until v24.3 added
# support for non-string data to concat():
# https://github.com/cockroachdb/cockroach/pull/127098#issuecomment-2492652084
"model_fields.test_uuid.TestQuerying.test_filter_with_expr",
})
else:
expected_failures.update({
# Unsupported query: unsupported binary operator: <int> / <int>:
Expand Down

0 comments on commit af5d6e3

Please sign in to comment.