get_records_preview
Preview real records from a RecordSet by running the data pipeline. Returns columns and sample rows to verify data quality before writing training code.
Instructions
Materializes the first records of a RecordSet by executing the data pipeline.
This tool runs the real ``mlcroissant`` operation graph: it downloads (or
resolves locally) the declared FileObjects/FileSets, applies extracts and
transforms, and yields actual records - exactly what
``Dataset.records(record_set)`` yields in Python.
Usage: Use it to preview/sample a dataset's actual data before writing
training code, or to sanity-check that a generated Croissant description
produces the expected columns and values.
IMPORTANT: For remote distributions this may download data; keep `limit`
small on large datasets. Datasets with inline `cr:data` return those rows
directly without downloads.
Returns:
--------
RecordsPreview containing:
- record_set: The RecordSet @id that was read.
- columns: Column names found across returned records.
- rows: List of records keyed by fully-qualified field ids.
- truncated: True if more records exist beyond `limit`.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of records to return (1-100). | |
| filters | No | Optional single-entry filter {field_id: value}, e.g. {"my_recordset/split": "train"} (only supported for fields extracted via regex transformations). | |
| jsonld_url | No | URL of a Croissant/GeoCroissant JSON-LD document. | |
| record_set | Yes | The @id of the RecordSet to read (see `list_record_sets` for available ids). | |
| jsonld_path | No | Path to a local Croissant/GeoCroissant file. | |
| jsonld_content | No | Raw JSON string of a Croissant document. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | The materialized records. | |
| columns | Yes | Column names found across the records. | |
| truncated | Yes | True when more records exist beyond the requested limit. | |
| record_set | Yes | The RecordSet @id records were read from. | |
| num_records | Yes | Number of records actually returned. |