Skip to content

API Reference parrot.semantic.dataset_source

github-actions[bot] edited this page Dec 2, 2026 · 1 revision

parrot.semantic.dataset_source

View source

DatasetManager source backed by one governed semantic model (FEAT-880).

Alias DataSource

Re-exported from parrot.tools.dataset_manager.sources.base.DataSource.

Alias PermissionContext

Re-exported from parrot.auth.PermissionContext.

Attribute QUERY_FIELDS

Type: frozenset[str]

Alias SemanticAccessError

Re-exported from parrot.semantic.errors.SemanticAccessError.

Class SemanticDataSource

Dataset source backed by one governed semantic model.

Parameter Type Default Description
name str
toolkit SemanticLayerToolkit
model str
default_query dict[str, Any] | None None
description str | None None
routing_meta dict | None None

Attributes:

Attribute Type Description
self_governed bool Always True: the semantic layer governs access itself.
has_builtin_cache bool Always True: DatasetManager must not cache these rows.
cache_key str Identifier only; never a cache key for rows.

Method SemanticDataSource.from_models_dir

Build a SemanticLayerToolkit and bind model; toolkit errors propagate unchanged.

from_models_dir(*, name: str, model: str, models_dir: Path, dialect: str, default_query: dict[str, Any] | None = None, description: str | None = None, **toolkit_kwargs: Any) -> 'SemanticDataSource'

Parameter Type Default Description
name str
model str
models_dir Path
dialect str
default_query dict[str, Any] | None None
description str | None None
**toolkit_kwargs Any {}

Returns: 'SemanticDataSource'

Method SemanticDataSource.describe

Return static text describing how to query this source.

describe() -> str

Returns: str

Method SemanticDataSource.prefetch_schema

Return {}: visible members depend on the caller's role.

prefetch_schema() -> dict[str, str]

Returns: dict[str, str]

Method SemanticDataSource.current_owner

Return the subject digest of the resolved context, or None; never raises.

current_owner() -> str | None

Returns: str | None

Method SemanticDataSource.fetch

Run one governed semantic query and return its rows (see spec §3 M4 for errors).

fetch(**params: Any) -> pd.DataFrame

Parameter Type Default Description
**params Any {}

Returns: pd.DataFrame

Alias SemanticLayerToolkit

Re-exported from parrot.semantic.toolkit.SemanticLayerToolkit.

Alias SemanticPolicyError

Re-exported from parrot.semantic.errors.SemanticPolicyError.

Alias SemanticQuery

Re-exported from parrot.semantic.models.SemanticQuery.

Alias SemanticValidationError

Re-exported from parrot.semantic.errors.SemanticValidationError.

Alias bind_semantic_context

Re-exported from parrot.semantic.context.bind_semantic_context.

Alias current_pctx

Re-exported from parrot.semantic.context.current_pctx.

Alias subject_digest

Re-exported from parrot.semantic.governance.pipeline.subject_digest.

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