Skip to content

Commit 78d19eb

Browse files
authored
Merge pull request #354 from django-daiquiri/dev
Release 1.3.5
2 parents 4db8b27 + 6da82b7 commit 78d19eb

File tree

8 files changed

+79
-46
lines changed

8 files changed

+79
-46
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@ updates:
33
- package-ecosystem: "pip" # See documentation for possible values
44
directory: "/" # Location of package manifests
55
schedule:
6-
interval: "weekly"
6+
interval: "weekly"
7+
ignore:
8+
- dependency-name: "Django"
9+
versions:
10+
- ">=5.3.0"

daiquiri/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = __version__ = '1.3.4'
1+
VERSION = __version__ = '1.3.5'

daiquiri/core/adapter/database/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def __init__(self, database_key, database_config):
1414
def connection(self):
1515
return connections[self.database_key]
1616

17-
def execute(self, sql):
18-
return self.connection().cursor().execute(sql)
17+
def execute(self, sql, args=None):
18+
return self.connection().cursor().execute(sql, args)
1919

2020
def fetchone(self, sql, args=None, as_dict=False):
2121
cursor = self.connection().cursor()

daiquiri/core/adapter/database/postgres.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,17 @@ def trim_table_rows(self, schema_name, table_name, max_records):
369369
if not self.table_exists(schema_name, table_name):
370370
return
371371

372-
query = (
373-
'DELETE FROM '
374-
+ f'{self.escape_identifier(schema_name)}.{self.escape_identifier(table_name)} '
375-
+ 'WHERE ctid NOT IN (SELECT ctid FROM '
376-
+ f'{self.escape_identifier(schema_name)}.{self.escape_identifier(table_name)} '
377-
+ f'LIMIT {max_records} );'
378-
)
379-
self.execute(query)
372+
user_table = f'{self.escape_identifier(schema_name)}.{self.escape_identifier(table_name)}'
373+
query = f"""DELETE FROM {user_table} as t
374+
USING (
375+
SELECT ctid
376+
FROM {user_table}
377+
ORDER BY ctid
378+
OFFSET %s
379+
) as d
380+
WHERE t.ctid = d.ctid;
381+
"""
382+
self.execute(query, args=[max_records,])
380383

381384
def table_exists(self, schema_name, table_name):
382385
check_query = (

daiquiri/query/tasks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def on_failure(self, exc, task_id, args, kwargs, einfo):
2828

2929
# log raised exception
3030
logger.error('run_query %s raised an exception (%s)', job_id, exc)
31+
logger.debug('run_query %s failed with an error: %s', job_id, einfo)
3132

3233
# set phase and error_summary of the crashed job
3334
job = QueryJob.objects.get(pk=job_id)

package-lock.json

Lines changed: 56 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "daiquiri",
3-
"version": "1.3.4",
3+
"version": "1.3.5",
44
"scripts": {
55
"build:prod": "webpack --config webpack.config.js --mode production",
66
"build": "webpack --config webpack.config.js --mode development",

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ dependencies = [
5151
"Markdown>=3.8.2,<3.11.0",
5252
"pandas>=2.3.2,<2.4.0",
5353
"passlib>=1.7.4",
54-
"pyarrow>=21.0.0,<21.1.0",
54+
"pyarrow>=21.0.0,<23.1.0",
5555
"Pygments~=2.19.2",
56-
"PyJWT~=2.10.1",
56+
"PyJWT>=2.10.1,<2.12.0",
5757
"queryparser-python3~=0.7.4",
5858
"rules~=3.5",
5959
"sqlalchemy>=2.0.43,<2.1.0",

0 commit comments

Comments
 (0)