Skip to main content

inspect_source

Function inspect_source 

Source
pub fn inspect_source(
    path: &str,
    sample_rows: usize,
) -> Result<InspectReport, McpError>
Expand description

Top-level dispatcher: pick the right inspector for path using the same extension + content-sniffing logic crate::ingest::detect_file_format drives for the ingest side. That shared dispatcher is what ensures inspect_file and load_file can never disagree on what a file is — if inspect says “this is JSONL”, load will try it as JSONL too.

§Errors

  • Returns ErrorCode::FileNotFound if path does not exist.
  • Propagates format-specific errors from the delegated inspector — inspect_parquet, inspect_arrow_ipc, inspect_json, or inspect_csv — each of which surfaces its own I/O, decoding, or schema-inference failures.