Skip to content

feat(etl)!: pluggable audit-column stampers — clean record shape by default#24

Merged
igor-ctrl merged 1 commit into
mainfrom
feat/etl-stamper-plugins
May 27, 2026
Merged

feat(etl)!: pluggable audit-column stampers — clean record shape by default#24
igor-ctrl merged 1 commit into
mainfrom
feat/etl-stamper-plugins

Conversation

@igor-ctrl

@igor-ctrl igor-ctrl commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

Makes the OSS dlt ETL pipeline emit a clean, vendor-neutral record shape. bcli etl sync no longer injects audit/metadata columns by default — any extra columns are opt-in through a pluggable stamper mechanism, so vendor-specific audit conventions live in downstream packages rather than the OSS core.

Mirrors the OSS-mechanism / downstream-content split already used for telemetry sinks, extract backends, packs, and ask context providers.

What changed

  • New bcli.etl.stampers entry-point group. A plugin exposes a zero-arg callable returning a Stamper = Callable[[list[dict]], list[dict]] (per-page row transform). bcli.etl._stamper_factory.build_stampers(names) resolves a config name-list to concrete stampers; unknown/failing names are skipped with a warning so one broken plugin never aborts a sync.
  • New [etl] stampers = [...] config (EtlConfig, wired into BCConfig) + bcli etl sync --stamper NAME (repeatable) per-run override.
  • bcli_profile() drops its built-in audit-column flag in favour of the generic stampers=[...] argument. Generic audit_stamper / company_id_stamper helpers stay in OSS.
  • _stamper_factory.py stays in the generic tier — no bcli.* import (enforced by the existing CI grep test, which now covers it).
  • Scrubbed vendor framing from ETL help text + docstrings.

Breaking change

bcli etl sync output schema changes: the previously-default audit columns disappear unless a stamper plugin is installed + opted in. Documented under ## [0.6.0] in CHANGELOG with a migration note. bcli just shipped 0.5.0, so 0.6.0 is the right home.

Downstream

Downstream packages register their own audit-column stampers under the new group and opt in via [etl] stampers, requiring bcli >= 0.6.0.

Test plan

  • uv run pytest946 passed, 5 skipped, 0 failed
  • uv run ruff check src/ tests/ — clean
  • New tests/test_etl/test_stamper_factory.py — discovery, ordered resolution, unknown-name skip, failing-factory skip, non-callable drop
  • bcli etl sync --help shows --stamper; copy is vendor-neutral
  • OSS smoke: discover_stamper_factories() == {} and build_stampers(["audit"]) warns + returns [] (no plugins shipped in OSS)
  • CI no-bcli.*-import test extended to _stamper_factory.py
  • Reviewer: confirm the breaking-change call is acceptable for 0.6.0

@igor-ctrl igor-ctrl force-pushed the feat/etl-stamper-plugins branch from fe40d0b to d4156a9 Compare May 27, 2026 12:47
BREAKING: bcli etl sync no longer injects audit/metadata columns by
default. The dlt pipeline emits a clean record shape; extra columns are
opt-in. Keeps vendor-specific audit conventions out of the OSS package.

- New `bcli.etl.stampers` entry-point group: a plugin exposes a zero-arg
  callable returning a Stamper (per-page row transform). `bcli.etl.
  _stamper_factory.build_stampers(names)` resolves a name list to concrete
  stampers, skip-with-warning on unknown/failing — mirrors the telemetry /
  ask factory dispatch. Stays in the generic tier (no bcli.* import;
  enforced by the existing CI grep test).
- New EtlConfig `[etl] stampers = [...]` opt-in + `bcli etl sync --stamper
  NAME` (repeatable) per-run override.
- `bcli_profile()` drops its built-in audit-column flag; generic
  audit_stamper / company_id_stamper stay.
- Scrubbed vendor framing from ETL help text + docstrings.

Downstream packages register their own audit stampers under the new
group and opt in via [etl] stampers, requiring bcli >= 0.6.0.
@igor-ctrl igor-ctrl force-pushed the feat/etl-stamper-plugins branch from d4156a9 to 8b32156 Compare May 27, 2026 12:58
@igor-ctrl igor-ctrl changed the title feat(etl)!: pluggable stampers — make OSS dlt pipeline Fivetran-agnostic feat(etl)!: pluggable audit-column stampers — clean record shape by default May 27, 2026
@igor-ctrl igor-ctrl merged commit 6d6f64b into main May 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant