Skip to content

API Reference parrot.tools.dataset_manager.spatial.registry

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

parrot.tools.dataset_manager.spatial.registry

View source

SPATIAL_PROFILE_REGISTRY — standalone profile store for DatasetManager spatial queries.

Implements brainstorm Option B: profiles live in a standalone registry keyed by dataset name; no co-registration with the DatasetManager at construction time.

Validate-at-execute discipline mirrors CompositeDataSource.fetch (composite.py:161): when the spatial_filter orchestration resolves a profile it validates that the referenced dataset actually exists in the DatasetManager, raising a descriptive ValueError naming the missing dataset.

Alias DatasetSpatialProfile

Re-exported from parrot.tools.dataset_manager.spatial.contracts.DatasetSpatialProfile.

Attribute SPATIAL_PROFILE_REGISTRY

Type: Dict[str, DatasetSpatialProfile]

Function get_spatial_profile

Look up a spatial profile by dataset name.

get_spatial_profile(dataset_name: str) -> DatasetSpatialProfile

Parameter Type Default Description
dataset_name str The dataset name (canonical, not an alias).

Returns: DatasetSpatialProfile — The registered DatasetSpatialProfile.

Raises:

  • ValueError — If no profile is registered for dataset_name. The error message names the missing dataset so the caller can surface a useful diagnostic (mirrors CompositeDataSource.fetch discipline).

Attribute logger

Function register_spatial_profile

Register (or replace) a spatial profile for a dataset.

Example::

register_spatial_profile(DatasetSpatialProfile(
    dataset="schools",
    geom_col="geog",
    layer="schools",
    property_cols=["name", "type"],
    description_template="{name} ({type})",
))

register_spatial_profile(profile: DatasetSpatialProfile) -> None

Parameter Type Default Description
profile DatasetSpatialProfile A validated DatasetSpatialProfile. The profile's dataset field is used as the registry key. If a profile for the same dataset already exists it is silently replaced.

Function validate_profiles_exist

Validate that every dataset name has a registered spatial profile.

Iterates all names and raises a single descriptive ValueError listing every missing profile — mirrors CompositeDataSource.fetch validation.

validate_profiles_exist(dataset_names: List[str]) -> None

Parameter Type Default Description
dataset_names List[str] List of canonical dataset names to check.

Raises:

  • ValueError — If any dataset name lacks a registered profile.

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