Skip to content

Commit 7e7326e

Browse files
committed
fix: #97 JSONField error in ClickHouse 24.8
1 parent 3705f61 commit 7e7326e

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### unreleased
22

3-
- fix: #99 fix update value containing "where" cause exception.
3+
- fix: #99 update value containing "where" cause exception.
4+
- fix: #97 JSONField error in ClickHouse 24.8.
45

56
### 1.3.0
67

clickhouse_backend/backend/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
3434
"BigAutoField": "Int64",
3535
"IPAddressField": "IPv4",
3636
"GenericIPAddressField": "IPv6",
37-
"JSONField": "JSON",
37+
"JSONField": "Object('json')",
3838
"BinaryField": "String",
3939
"CharField": "FixedString(%(max_length)s)",
4040
"DateField": "Date32",

docs/Fields.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ MapModel.objects.annotate(
639639

640640
### JSON
641641

642+
**Note:** Object('json') type [is not production-ready and is now deprecated](https://clickhouse.com/docs/en/sql-reference/data-types/object-data-type).
643+
642644
Field importing path: `clickhouse_backend.models.JSONField`.
643645

644646
Neither Nullable nor LowCardinality is supported.

tests/clickhouse_fields/test_jsonfield.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .models import JSONModel
66

77

8-
class MapFieldTests(TestCase):
8+
class JsonFieldTests(TestCase):
99
def test_disallow_nullable(self):
1010
field = models.JSONField(null=True, name="field")
1111
self.assertEqual(

tests/settings.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"alter_sync": 2,
3030
"allow_suspicious_low_cardinality_types": 1,
3131
"allow_experimental_object_type": 1,
32-
"allow_experimental_json_type": 1,
3332
},
3433
},
3534
"TEST": {"cluster": "cluster"},
@@ -47,7 +46,6 @@
4746
"alter_sync": 2,
4847
"allow_suspicious_low_cardinality_types": 1,
4948
"allow_experimental_object_type": 1,
50-
"allow_experimental_json_type": 1,
5149
},
5250
},
5351
"TEST": {"cluster": "cluster", "managed": False},
@@ -65,7 +63,6 @@
6563
"alter_sync": 2,
6664
"allow_suspicious_low_cardinality_types": 1,
6765
"allow_experimental_object_type": 1,
68-
"allow_experimental_json_type": 1,
6966
},
7067
},
7168
"TEST": {"cluster": "cluster", "managed": False},

0 commit comments

Comments
 (0)