Skip to content

Commit 42e23ca

Browse files
committed
feat: Django 5.2 Support #122
1 parent 493b422 commit 42e23ca

File tree

7 files changed

+12
-24
lines changed

7 files changed

+12
-24
lines changed

.github/workflows/base-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
python-version: ["3.10", "3.13"]
16-
django-version: ["3.2", "4.0", "4.1", "4.2", "5.0", "5.1"]
16+
django-version: ["3.2", "4.0", "4.1", "4.2", "5.0", "5.1", "5.2"]
1717
clickhouse-version: ["23.8", "latest"]
1818
include:
1919
- python-version: "3.7"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- feat: #119 Allow query results returned in columns and deserialized to `numpy` objects
44
- feat: #125 Add database functions `toStartOfMinute`, `toStartOfFiveMinutes`, `toStartOfTenMinutes`, `toStartOfFifteenMinutes` and `toStartofHour`
5+
- feat: #122 Django 5.2 Support
56

67
### 1.3.2
78

clickhouse_backend/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from clickhouse_backend.utils.version import get_version
22

3-
VERSION = (1, 3, 2, "final", 0)
3+
VERSION = (1, 4, 0, "final", 0)
44

55
__version__ = get_version(VERSION)

clickhouse_backend/models/sql/compiler.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -286,27 +286,6 @@ def as_sql(self, with_limits=True, with_col_aliases=False):
286286

287287

288288
class SQLInsertCompiler(compiler.SQLInsertCompiler):
289-
def field_as_sql(self, field, val):
290-
"""
291-
Take a field and a value intended to be saved on that field, and
292-
return placeholder SQL and accompanying params. Check for raw values,
293-
expressions, and fields with get_placeholder() defined in that order.
294-
295-
When field is None, consider the value raw and use it as the
296-
placeholder, with no corresponding parameters returned.
297-
"""
298-
if field is None:
299-
# A field value of None means the value is raw.
300-
sql, params = val, []
301-
elif hasattr(val, "as_sql"):
302-
# This is an expression, let's compile it.
303-
sql, params = self.compile(val)
304-
else:
305-
# Return the common case for the placeholder
306-
sql, params = "%s", [val]
307-
308-
return sql, params
309-
310289
def as_sql(self):
311290
# We don't need quote_name_unless_alias() here, since these are all
312291
# going to be column names (so we can avoid the extra overhead).

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ classifiers = [
2222
"Framework :: Django :: 5",
2323
"Framework :: Django :: 5.0",
2424
"Framework :: Django :: 5.1",
25+
"Framework :: Django :: 5.2",
2526
"Intended Audience :: Developers",
2627
"License :: OSI Approved :: MIT License",
2728
"Programming Language :: Python",

tests/aggregation/tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,8 @@ def test_annotated_aggregate_over_annotated_aggregate(self):
10971097
Book.objects.annotate(Max("id")).annotate(Sum("id__max"))
10981098

10991099
class MyMax(Max):
1100+
arity = None
1101+
11001102
def as_sql(self, compiler, connection):
11011103
self.set_source_expressions(self.get_source_expressions()[0:1])
11021104
return super().as_sql(compiler, connection)

tox.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
[tox]
22
requires =
33
tox>=4
4-
env_list = py3.7-django3.2, py{3.8,3.9}-django{3.2,4.0,4.1,4.2}, py{3.10,3.11,3.12}-django{3.2,4.0,4.1,4.2,5.0,5.1}, py3.13-django{4.1,4.2,5.0,5.1}
4+
env_list =
5+
py3.7-django3.2
6+
py{3.8,3.9}-django{3.2,4.0,4.1,4.2}
7+
py{3.10,3.11,3.12}-django{3.2,4.0,4.1,4.2,5.0,5.1,5.2}
8+
py3.13-django{4.1,4.2,5.0,5.1,5.2}
59

610
[variables]
711
code = clickhouse_backend example tests
@@ -14,6 +18,7 @@ deps =
1418
django4.2: Django>=4.2,<5.0
1519
django5.0: Django>=5.0,<5.1
1620
django5.1: Django>=5.1,<5.2
21+
django5.2: Django>=5.2,<5.3
1722
coverage
1823
commands =
1924
pip install pandas

0 commit comments

Comments
 (0)