Skip to content

API Reference parrot.tools.dataset_manager.filtering.values

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.tools.dataset_manager.filtering.values

View source

Value catalog helpers for FEAT-225 Module 5.

Provides utilities for collecting distinct column values from a set of DatasetEntry objects — used by DatasetManager.get_filter_values to populate frontend combo selectors.

Attribute DEFAULT_CARDINALITY_CAP

Type: int

Function apply_cardinality_cap

Truncate values to at most cap items, logging a warning if truncated.

apply_cardinality_cap(values: List[Any], cap: int = DEFAULT_CARDINALITY_CAP, filter_name: str = '', log: Optional[logging.Logger] = None) -> List[Any]

Parameter Type Default Description
values List[Any] The full value list.
cap int DEFAULT_CARDINALITY_CAP Maximum number of values to return.
filter_name str '' Used in the warning message for context.
log Optional[logging.Logger] None Logger to use; falls back to the module logger.

Returns: List[Any] — The (possibly truncated) value list.

Function infer_values_from_datasets

Collect distinct values for column from in-memory datasets.

Only datasets that are already materialized (entry._df is not None) and have column in their DataFrame are queried — this avoids triggering I/O.

infer_values_from_datasets(column: str, datasets: Dict[str, Any], restrict_to_dataset: Optional[str] = None) -> List[Any]

Parameter Type Default Description
column str The column name to collect distinct values from.
datasets Dict[str, Any] Mapping of dataset-name → DatasetEntry.
restrict_to_dataset Optional[str] None When provided, only the named dataset is queried.

Returns: List[Any] — Sorted, de-duplicated list of values. Empty list if no dataset has the column in its loaded DataFrame.

Attribute logger

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally