Skip to content

v0.10.0

Choose a tag to compare

@Saevarl Saevarl released this 09 Jul 16:48
· 29 commits to main since this release

Kontra 0.10.0

Transformation probes gain FK→PK key support, profile history becomes a first‑class Python API, and a batch of database‑path fixes land for SQL Server and Entra ID auth.

✨ New features

  • Different‑named join keys for transformation probes. compare() accepts before_key=/after_key= and profile_relationship() accepts left_on=/right_on= (pandas‑merge naming) for the common FK→PK case. The symmetric key=/on= forms still work; composite keys pair positionally.
    kontra.compare(tickets, orgs, before_key="organization_id", after_key="id")
    kontra.profile_relationship(tickets, orgs, left_on="organization_id", right_on="id")
  • Profile history in the Python API. kontra.profile(..., save=True), get_profile(), list_profiles(), and profile_diff() are now fully wired to the same store the CLI uses — profiles saved from Python and from kontra profile --save-profile are interchangeable.
  • PostgreSQL profile store. get_profile_store("postgres", uri=...) persists profiles to a shared kontra_profiles table for multi‑host setups (local .kontra/profiles/ remains the default).
  • Open annotation vocabulary. Any non‑empty annotation_type is accepted; two new documented types — diagnosis (first‑responder assessment) and expected (owner adjudication verdict).

🐛 Fixes

  • SQL Server Entra ID on Windows. msodbcsql18 rejects the Authentication=ActiveDirectory* keywords for token modes on Windows; Kontra now acquires the token via azure-identity and passes it through pyodbc attrs_before. entra_password remains the azure‑identity‑free fallback on all platforms.
  • Entra entra_password now correctly retains URI userinfo (UID/PWD).
  • Transformation‑probe materialization on SQL Server (pyodbc). Fixed a ShapeError (Row→tuple) and truncated dtype inference (columns NULL in the first 100 rows now infer correctly).
  • SQL Server scan profiling overflow. Numeric aggregates are widened (AVG/SUM args cast) so wide‑range integer columns no longer raise "Arithmetic overflow converting expression to data type int".
  • Trustworthy uniqueness on identifier columns. Estimated distinct counts for id‑like columns on tables ≤ 1M rows are refined with an exact COUNT(DISTINCT) — no more phantom duplicates (uniqueness_ratio < 1.0 on a genuinely unique key).
  • Constant columns surface their value. A distinct_count == 1 column now reports its single value in top_values/values on every backend.
  • kontra.set_config() is honored everywhere. Config‑path overrides now apply across validate(), datasource resolution, and state — previously only health() respected them.

⚠️ Notable changes

  • kontra.profile(save=...) now defaults to False. The kwarg was previously accepted but never acted on; it now works, and defaults to off to avoid surprise writes. Pass save=True to persist. Inline DataFrame profiles have no stable identity and are not saved.
  • The sqlserver-entra extra now also installs azure-identity (for the Windows token path).

📚 Docs

Updated across transformation probes, the Python API, profile history & store backends, SQL Server Entra config, and profiling‑estimate semantics.

Install

pip install --upgrade kontra # or: pip install kontra==0.10.0

Full changeset: everything above shipped under a single squashed commit gated by the full suite (1585 tests, 0 failures) across live PostgreSQL, SQL Server, and DuckDB.