fix(core): preserve adapter command contracts

This commit is contained in:
2026-07-11 21:00:50 +02:00
parent dbbab6d005
commit a35efa16de
20 changed files with 163 additions and 143 deletions
+6 -4
View File
@@ -22,8 +22,10 @@ class ThothRestDwhAdapter:
result = self._client.ping()
except RestError as exc:
return DwhHealth(ok=False, detail=str(exc))
ok = bool(result.get("db_connected", True))
return DwhHealth(ok=ok, detail=None if ok else str(result))
ok = bool(result.get("db_connected") and result.get("schema_accessible"))
return DwhHealth(ok=ok, detail=None if ok else str(result),
database=self._database.database, schema=self._database.db_schema,
endpoint=self._client.cfg.base_url, read_only=True)
def introspect(self) -> PhysicalSchema:
return introspect_rest(
@@ -44,10 +46,10 @@ class ThothRestDwhAdapter:
except RestError as exc:
raise ExecutionError(str(exc)) from exc
def distinct_values(self, table: str, column: str) -> DistinctValues:
def distinct_values(self, table: str, column: str, *, limit: int) -> DistinctValues:
try:
return sampling.distinct_values_rest(
self._client, self._database.db_schema, table, column
self._client, self._database.db_schema, table, column, max_values=limit
)
except RestError as exc:
raise ExecutionError(str(exc)) from exc