Skip to content

Commit cc05979

Browse files
committed
Propagate Dolt conformance through in-place writes
1 parent dff51d1 commit cc05979

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

‎src/openstatspec/sql/inplace_transform.py‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
transformation_plan_from_dict,
2222
)
2323
from .capabilities import effective_profile
24+
from .dolt_conformance import DoltConformanceSource
2425
from .normative import catalog as core_catalog
2526
from .wide import catalog as legacy_catalog
2627
from .wide import normalized_metadata_tables, physical_name
@@ -554,11 +555,17 @@ def _dolt_state(connection: Any) -> tuple[str, str, int]:
554555
return branch, head, dirty
555556

556557

557-
def install_in_place_transformation_schema(*, database_url: str) -> None:
558+
def install_in_place_transformation_schema(
559+
*,
560+
database_url: str,
561+
dolt_conformance_source: DoltConformanceSource | None = None,
562+
) -> None:
558563
"""Install the compact operation audit separately from any data apply."""
559564
# Resolve the effective profile first so Dolt conformance and explicit
560565
# driver checks fail closed before an engine transaction can execute DDL.
561-
effective_profile(database_url)
566+
effective_profile(
567+
database_url, dolt_conformance_source=dolt_conformance_source,
568+
)
562569
engine = create_engine(database_url)
563570
try:
564571
with engine.begin() as connection:
@@ -595,13 +602,16 @@ def _run_in_place_submission(
595602
prepare: Callable[[Any, str], InPlacePlanSubmission],
596603
expected_branch: str | None = None,
597604
expected_head: str | None = None,
605+
dolt_conformance_source: DoltConformanceSource | None = None,
598606
) -> dict[str, Any]:
599607
"""Prepare and apply one canonical plan in the same controlled transaction."""
600608
if not actor:
601609
raise TransformationError(
602610
"actor_required", "A non-empty actor identity is mandatory.",
603611
)
604-
profile, _active = effective_profile(database_url)
612+
profile, _active = effective_profile(
613+
database_url, dolt_conformance_source=dolt_conformance_source,
614+
)
605615
engine = create_engine(database_url)
606616
try:
607617
with engine.begin() as connection:
@@ -662,6 +672,7 @@ def apply_transformation_plan_in_place(
662672
actor: str,
663673
expected_branch: str | None = None,
664674
expected_head: str | None = None,
675+
dolt_conformance_source: DoltConformanceSource | None = None,
665676
) -> dict[str, Any]:
666677
"""Apply a canonical plan without knowing which frontend produced it."""
667678
normalized = (
@@ -682,4 +693,5 @@ def apply_transformation_plan_in_place(
682693
prepare=lambda _connection, _dataset_id: submission,
683694
expected_branch=expected_branch,
684695
expected_head=expected_head,
696+
dolt_conformance_source=dolt_conformance_source,
685697
)

0 commit comments

Comments
 (0)