Skip to content

[BUG] load_data_source validation gaps: non-numeric target passes, 1–2 row load blocked, file loader leaks internals #533

Description

@Shashankss1205

Severity: P1 (dtype) + P2 (row-count, error quality). Verified live 2026-08-09.

load_data_source validation runs but doesn't check the things fit actually needs, and several failure paths leak pandas internals. Three related findings:

NB-07 — non-numeric (object-dtype) target passes validation silently (P0-ish)

load_data_source(config={"type":"pandas",
  "data":{"date":["2024-01-01","2024-02-01","2024-03-01"], "value":["1","2","3"]},
  "time_column":"date","target_column":"value"})
-> {"success": true, "dtypes": {"value": "object"}, "validation": {"valid": true}}

inspect_data then returns categorical stats ({count, unique, top, freq}, no mean/min/max). It fails much later, inside fit. Same gap for object-dtype exogenous columns.
Fix: error, or at least warn, on a non-numeric target/exog dtype at load.

NB-06 — 1–2 row series cannot be loaded at all (P1)

load_data_source(... 1 row ...)
-> {"success": false, "error": "Need at least 3 dates to infer frequency", "error_type": "ValueError"}

This is a leaked pandas internal, and it's inconsistent: split_data happily creates 1-row handles, so 1-row data is representable — only loading is blocked.
Fix: load with freq=None + a warning, or a clear "at least 3 timestamped rows required to infer frequency" message.

NB-11 — file loader leaks parse_dates internals for a bad time_column (P2)

load_data_source(config={"type":"file","path":"...csv","time_column":"index", ...})
-> {"error": "Error reading CSV file: Missing column provided to 'parse_dates': 'index'"}

The pandas-source path gives a clean "Time column 'x' not found in data"; the file path should match it (and ideally list available columns).

(Catalogued as NB-07 / NB-06 / NB-11 in MCP_TEST_FINDINGS.md. Related to existing #313.)

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