fix(data-process): 修复三数据集发布参数错误
This commit is contained in:
@@ -1399,8 +1399,11 @@ class DataProcessStore:
|
|||||||
size, size_bytes, count, record_count, description, metadata,
|
size, size_bytes, count, record_count, description, metadata,
|
||||||
tenant_id, project_id, owner_id, created_by, create_time,
|
tenant_id, project_id, owner_id, created_by, create_time,
|
||||||
created_at, updated_at)
|
created_at, updated_at)
|
||||||
VALUES (%s, %s, %s, %s, 'task', %s, %s, %s, %s, %s, %s,
|
VALUES (
|
||||||
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
|
%s, %s, %s, %s, 'task', %s, %s,
|
||||||
|
%s, %s, %s, %s, %s, %s,
|
||||||
|
%s, %s, %s, %s, %s, %s, %s
|
||||||
|
)
|
||||||
RETURNING *
|
RETURNING *
|
||||||
""",
|
""",
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Iterator
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from typing import Any, Iterator
|
from typing import Any
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@@ -35,6 +36,12 @@ class _PublishConnection:
|
|||||||
|
|
||||||
def execute(self, sql: str, params: Any = None) -> _Result:
|
def execute(self, sql: str, params: Any = None) -> _Result:
|
||||||
normalized = " ".join(sql.split())
|
normalized = " ".join(sql.split())
|
||||||
|
if params is not None:
|
||||||
|
placeholder_count = normalized.count("%s")
|
||||||
|
assert placeholder_count == len(params), (
|
||||||
|
f"SQL placeholder count {placeholder_count} does not match "
|
||||||
|
f"parameter count {len(params)}"
|
||||||
|
)
|
||||||
if normalized.startswith("SELECT * FROM data_process_results"):
|
if normalized.startswith("SELECT * FROM data_process_results"):
|
||||||
return _Result(rows=self.results)
|
return _Result(rows=self.results)
|
||||||
if normalized.startswith("SELECT * FROM datasets WHERE source_task_id"):
|
if normalized.startswith("SELECT * FROM datasets WHERE source_task_id"):
|
||||||
|
|||||||
Reference in New Issue
Block a user