fix(data-process): 修复三数据集发布参数错误
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Iterator
|
||||
from contextlib import contextmanager
|
||||
from decimal import Decimal
|
||||
from typing import Any, Iterator
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -35,6 +36,12 @@ class _PublishConnection:
|
||||
|
||||
def execute(self, sql: str, params: Any = None) -> _Result:
|
||||
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"):
|
||||
return _Result(rows=self.results)
|
||||
if normalized.startswith("SELECT * FROM datasets WHERE source_task_id"):
|
||||
|
||||
Reference in New Issue
Block a user