Skip to main content
Class representing a dataset result including the data and metadata. Extends DatasetMetadata. Instances of DatasetResult are created and returned by Squirrels dataset execution APIs (for example, in dataset routes or project methods); you should not construct this class directly. If DatasetResult is needed for type annotation, it can be imported from the squirrels.types or squirrels module.

Attributes

pl.DataFrame
The dataset as a Polars DataFrame

Methods

to_json()

Returns the dataset as a JSON-serializable dictionary with pagination support.
dict
A dictionary containing the dataset with data and metadata. The structure includes:

Examples

Here are some common usage patterns for the DatasetResult class. It is assumed that the code is running in an async context (e.g. inside an async function or a Jupyter Notebook cell).

Query a dataset and access the dataframe

Export dataset to JSON with different orientations