Skip to content

innovate.ingest_local

All current Python definitions

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

def ingest_local(
path: str | Path,
kind: str,
*,
provenance: dict[str, Any],
format: str | None = None,
unit: str | None = None,
directed: bool = False,
) -> dict[str, Any]: ...

Read a local table and pass it through native dataset ingestion.

CSV identifier columns are read as strings for competition, policy-timing and network-edge datasets so numeric-looking identifiers are not intentionally converted to numbers. A load:<filename> transform and the path and format are added to provenance. The path is therefore retained in the output artifact; use suitable paths and provenance when the artifact will be shared.

  • path: Existing local file path; URLs and directories are not supported.
  • kind: Native dataset kind accepted by ingest_polars.
  • provenance: Native provenance mapping. Existing transform steps and extra fields are preserved except for the added path/format fields.
  • format: Explicit format or, by default, the path’s suffix. Accepted values are csv/txt, parquet/pq, arrow/feather/ipc, and stream/ipc_stream; leading dots and case are normalized. Arrow/file aliases inspect the leading IPC file magic to select the reader.
  • unit: Optional dataset unit passed unchanged to ingest_polars.
  • directed: Network-edge direction flag, defaulting to False; ignored for other dataset kinds.

Native validated, checksummed ingestion result with augmented provenance. The full table is read locally before native validation.

  • FileNotFoundError: If the supplied path is not an existing regular file.
  • ValueError: If the format or dataset kind is unsupported, columns are missing, or JSON serialization encounters non-finite values.
  • NativeError: If dataset or provenance validation fails.
  • OSError: If the file cannot be opened or read.
  • TypeError: If provenance fields or serialized values have incompatible types.
  • polars.exceptions.PolarsError: If parsing, schema conversion or ingestion casting fails.