Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/base-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.10", "3.13"]
django-version: ["3.2", "4.0", "4.1", "4.2", "5.0", "5.1"]
django-version: ["3.2", "4.0", "4.1", "4.2", "5.0", "5.1", "5.2"]
clickhouse-version: ["23.8", "latest"]
include:
- python-version: "3.7"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

### 1.3.2

Expand Down
2 changes: 1 addition & 1 deletion clickhouse_backend/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from clickhouse_backend.utils.version import get_version

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

__version__ = get_version(VERSION)
21 changes: 0 additions & 21 deletions clickhouse_backend/models/sql/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,27 +286,6 @@ def as_sql(self, with_limits=True, with_col_aliases=False):


class SQLInsertCompiler(compiler.SQLInsertCompiler):
def field_as_sql(self, field, val):
"""
Take a field and a value intended to be saved on that field, and
return placeholder SQL and accompanying params. Check for raw values,
expressions, and fields with get_placeholder() defined in that order.

When field is None, consider the value raw and use it as the
placeholder, with no corresponding parameters returned.
"""
if field is None:
# A field value of None means the value is raw.
sql, params = val, []
elif hasattr(val, "as_sql"):
# This is an expression, let's compile it.
sql, params = self.compile(val)
else:
# Return the common case for the placeholder
sql, params = "%s", [val]

return sql, params

def as_sql(self):
# We don't need quote_name_unless_alias() here, since these are all
# going to be column names (so we can avoid the extra overhead).
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ classifiers = [
"Framework :: Django :: 5",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Framework :: Django :: 5.2",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
Expand Down
2 changes: 2 additions & 0 deletions tests/aggregation/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,8 @@ def test_annotated_aggregate_over_annotated_aggregate(self):
Book.objects.annotate(Max("id")).annotate(Sum("id__max"))

class MyMax(Max):
arity = None

def as_sql(self, compiler, connection):
self.set_source_expressions(self.get_source_expressions()[0:1])
return super().as_sql(compiler, connection)
Expand Down
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[tox]
requires =
tox>=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}
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,5.2}
py3.13-django{4.1,4.2,5.0,5.1,5.2}

[variables]
code = clickhouse_backend example tests
Expand All @@ -14,6 +18,7 @@ deps =
django4.2: Django>=4.2,<5.0
django5.0: Django>=5.0,<5.1
django5.1: Django>=5.1,<5.2
django5.2: Django>=5.2,<5.3
coverage
commands =
pip install pandas
Expand Down