Skip to content

RV-F7: confirmed header mappings silently ignored (API model has no headerMapping field) #186

Closed

Description

@amar-python

What happened

External repo review at commit c7bebd1: the frontend sends headerMapping; the API request model in api/routers/csv_routes.py L38–45 has no such field. Pydantic silently discards it. Confirmed header renames leave the imported column name unchanged.

Code paths:

  • csv-table-hub-main/src/lib/csv.functions.ts L151–171 (frontend sends it)
  • api/routers/csv_routes.py L38–45 (API ignores it)

Why this matters

The advertised "confirm header mapping" control does nothing. User expects renamed columns in the imported table; gets the original CSV headers. No error, no indication the mapping was dropped.

Two acceptable resolutions:

  • Implement: add headerMapping to the API request model, validate it, apply it during the load.
  • Remove: drop the UI control entirely so users don't see a broken feature.

Either is better than the current state.

Proposed

Decision needed on the issue:

  • (a) Implement a validated mapping contract (API model + loader passes mapping into dynamic/T&E load paths).
  • (b) Remove the ineffective UI control.

Claude recommends (a) for dynamic mode (where user-friendly column renames are useful) and (b) for T&E mode (where columns must match the fixed schema exactly, so renaming is moot).

Tests must assert the resulting database column names, not just the frontend request object.

Done when

  • Decision (a) or (b) taken.
  • If (a): reproduction test maps foo → bar and asserts the DB column is bar.
  • If (b): UI control removed and vitest coverage of the removal.

Reference

Tracker row G50. Repo review finding RV-F7. Related: #154 frontend decision affects (b) (the UI control is in Lovable code).

Activity

  1. added this to the ART extension milestone on Nov 3, 2026
  2. amar-python commented on Nov 9, 2026

    @amar-python
    OwnerAuthor

    Fixed by #202 (merged as 203c8ae), taking the issue's recommendation: dynamic mode applies the confirmed header mapping (unknown, repeated or colliding renames are rejected with invalid_header_mapping), and T&E mode returns 422 for a mapping instead of silently ignoring it. tests/test_header_mapping.py maps foo to bar and asserts the resulting database column name. The React app already sends no mapping in T&E mode, so nothing there needed changing.


    Generated by Claude Code

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

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions