Skip to content

Make batch failure tracking fail-loud, not observability-only (C-21) #14

Closed

Description

@Polichinel

Context

enrich_dataframe_with_pg_info and enrich_dataframe_with_country_info track failed batches via failed_batches counter and summary ERROR log. But:

  • failed_batches and failed_gids are NOT included in the return value
  • The caller receives a partial DataFrame with NaN rows and no programmatic signal
  • This does not satisfy ADR-003's fail-loud requirement

The downstream _validate() catches the NaN but the error message says "null values in country_iso_a3" — misleading the operator toward spatial mapping issues rather than batch computation failures.

Requirements

Either:

  • Option A: Raise an exception when failed_batches > 0 (strict fail-loud)
  • Option B: Return failed_gids alongside the DataFrame (e.g., as a tuple or DataFrame attribute)
  • Option C: Add a strict=True parameter — when True, raise on batch failure; when False, log-only (current behavior)

Risk Register

C-21 (Tier 2). Part of Cluster B.

Note

If ADR-011 replaces the mapper with a Parquet lookup, batch failures become impossible (a merge can't fail per-batch). This concern becomes moot.

Activity

  1. Polichinel commented on Jun 26, 2026

    @Polichinel
    CollaboratorAuthor

    Status vs current development (2026-06-27): MOOT — recommend close.
    ADR-011 replaced the batch mapper with the GaulLookupEnricher (a parquet merge). There is no batch loop, no failed_batches/failed_gids counter — enrich_dataframe_with_pg_info even documents batch_size/use_multiprocessing as ignored mapper-only kwargs. A merge can't fail per-batch, so the partial-DataFrame-without-signal failure mode this issue describes can no longer occur. This is exactly the obsolescence the issue's own Note anticipated. Unmapped cells are now caught loud by _validate (null gate) and surfaced in provenance (unmapped_count, S5). Recommend closing as obsolete.

  2. Polichinel commented on Jun 27, 2026

    @Polichinel
    CollaboratorAuthor

    Closing as obsolete per the status update above — ADR-011's merge-based GaulLookupEnricher removed the batch machinery this concern depends on; per-batch failure is no longer possible. Unmapped cells are caught loud by _validate and surfaced in S5 provenance (unmapped_count).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions