Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Changed

- The "mode_type not allowed for kind" contract error now quotes the offending
`mode_type` and `kind` (`repr`), matching the sibling "must be one of" error,
so an empty or whitespace value is legible. Docstring fixes only alongside:
the postgres `ensure_table` port-signature reference (0.6.0 → 0.8.0) and the
`ensure_unique_key` message-order claim (pyarrow grouping order is not
contractual).

## [0.9.0] - 2026-10-11

### Added
Expand Down
2 changes: 1 addition & 1 deletion adapters/postgres/continuo_postgres_adapter/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def ensure_table(
this engine's physical-layout vocabulary — ``indexes`` — validated by
:func:`_validated_indexes` before any DDL runs, so a malformed config
never leaves a half-built table behind (fail closed). Required and
keyword-only, matching the contract 0.6.0 port signature. The create
keyword-only, matching the contract 0.8.0 port signature. The create
and every index either all land or none do, in the same explicit
BEGIN/COMMIT/ROLLBACK shape build_empty_from_columns uses.

Expand Down
2 changes: 1 addition & 1 deletion continuo_python_runtime/contract/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def parse_node(
)
if mode_type not in rules.mode_types:
raise ContractError(
f"{label}: 'mode_type' {mode_type} is not allowed for kind {kind} "
f"{label}: 'mode_type' {mode_type!r} is not allowed for kind {kind!r} "
f"(allowed: {sorted(rules.mode_types)})"
)

Expand Down
6 changes: 3 additions & 3 deletions contract/continuo_engine_contract/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def ensure_unique_key(data: "pyarrow.Table", primary_key: Sequence[str]) -> None
Groups the rows by the key columns. NULL counts as a value here; the
contract requires every key column to be ``nullable: false`` and the
harness's ``conform()`` rejects NULLs in such columns before this runs.
The message names the first repeated keys, in order of first appearance,
with their row counts. Only methods of *data* are called, so this module
needs no pyarrow import.
The message names up to a fixed number of the repeated keys with their row
counts; their order follows pyarrow's grouping and is not contractual. Only
methods of *data* are called, so this module needs no pyarrow import.

Raises:
ValueError: If *primary_key* is empty, names a column *data* lacks, or
Expand Down
2 changes: 1 addition & 1 deletion tests/contract/test_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ def test_python_csv_only_allows_replace(mode):
entry = _csv_entry(mode_type=mode)
if mode == "upsert":
entry["primary_key"] = ["order_id"]
with pytest.raises(ContractError, match=f"'mode_type' {mode} is not allowed for kind python-csv"):
with pytest.raises(ContractError, match=f"'mode_type' '{mode}' is not allowed for kind 'python-csv'"):
parse_node(entry, "f.yml", check_reads=False)


Expand Down
Loading