plexus.reports.blocks.data_utils module

Utility functions for data source and dataset management in report blocks.

class plexus.reports.blocks.data_utils.DatasetResolver(client: PlexusDashboardClient)

Bases: object

Handles resolution and caching of datasets from DataSource or DataSet records.

__init__(client: PlexusDashboardClient)
clear_cache(identifier: str | None = None)

Clear dataset cache. If identifier provided, clear only that dataset.

async resolve_and_cache_dataset(source: str | None = None, dataset: str | None = None, fresh: bool = False) Tuple[str | None, Dict[str, Any] | None]

Resolve a dataset from either a DataSource or DataSet identifier and cache locally.

Args:

source: DataSource identifier (name, key, or ID) dataset: DataSet ID fresh: If True, bypass cache and fetch from API

Returns:

Tuple of (local_file_path, metadata_dict) or (None, None) if failed