mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-07 07:55:13 +02:00
refactor: remove legacy ktx compatibility shims (#211)
* refactor: remove legacy ktx compatibility shims * fix: restore overlay collision guidance
This commit is contained in:
parent
a954a29a76
commit
96952fb43c
59 changed files with 294 additions and 342 deletions
|
|
@ -138,6 +138,18 @@ def test_introspect_database_response_rejects_non_postgres_driver() -> None:
|
|||
)
|
||||
|
||||
|
||||
def test_introspect_database_response_rejects_legacy_postgresql_driver() -> None:
|
||||
with pytest.raises(ValueError, match='supports only driver "postgres"'):
|
||||
introspect_database_response(
|
||||
DatabaseIntrospectionRequest(
|
||||
connection_id="warehouse",
|
||||
driver="postgresql",
|
||||
url="postgresql://readonly@example.test/warehouse",
|
||||
),
|
||||
load_rows=lambda request: DatabaseIntrospectionRows([], [], []),
|
||||
)
|
||||
|
||||
|
||||
def test_database_introspection_request_rejects_empty_schema_list() -> None:
|
||||
with pytest.raises(ValueError, match="at least one schema"):
|
||||
DatabaseIntrospectionRequest(
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ from __future__ import annotations
|
|||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from ktx_daemon.semantic_layer import (
|
||||
SemanticLayerQueryRequest,
|
||||
ValidateSourcesRequest,
|
||||
|
|
@ -95,6 +97,16 @@ def test_query_semantic_layer_emits_plan_and_sql_debug_events(
|
|||
assert "public.orders" not in captured.err
|
||||
|
||||
|
||||
def test_semantic_layer_request_rejects_project_id_field_name() -> None:
|
||||
with pytest.raises(ValueError):
|
||||
SemanticLayerQueryRequest(
|
||||
sources=[],
|
||||
dialect="postgres",
|
||||
project_id="a" * 64,
|
||||
query={"measures": ["orders.order_count"]},
|
||||
)
|
||||
|
||||
|
||||
def test_validate_semantic_layer_reports_duplicate_measure_names() -> None:
|
||||
invalid_source = {
|
||||
**ORDERS_SOURCE,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue