Skip to content

API Reference parrot.tools.dataset_manager.filtering.store

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

parrot.tools.dataset_manager.filtering.store

View source

Pure validation helpers for the FilterDefinition instance store (FEAT-225 Module 2).

These functions are I/O-free and test-friendly. DatasetManager.define_filters delegates column-presence checks here so that the logic is independently testable.

Function columns_present_in_any

Return names of datasets that contain ALL of the given columns.

A dataset is considered potentially compatible when:

  • Its _column_types dict is non-empty (meaning the schema has been prefetched or materialised) AND every column in columns is a key.
  • OR its _column_types is empty/unknown (not yet materialised) — in this case we cannot definitively exclude it; it is NOT included in the compatible set but also not treated as failing.

columns_present_in_any(columns: List[str], datasets: Dict[str, Any]) -> List[str]

Parameter Type Default Description
columns List[str] Column names the filter requires.
datasets Dict[str, Any] Mapping of dataset-name → DatasetEntry.

Returns: List[str] — List of dataset names whose known schema contains all columns.

Attribute logger

Function warn_if_no_coverage

Log a warning when no registered dataset covers the column(s).

This is a non-fatal advisory — datasets may be added later, or their schemas may not yet be prefetched.

warn_if_no_coverage(definition_name: str, columns: List[str], compatible: List[str], log: Optional[logging.Logger] = None) -> None

Parameter Type Default Description
definition_name str The FilterDefinition name (for the log message).
columns List[str] The target column(s).
compatible List[str] Datasets found to be compatible (may be empty).
log Optional[logging.Logger] None Logger instance to use; falls back to the module 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