Skip to content

API Reference parrot.tools.dataset_manager.sources.opaque

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

parrot.tools.dataset_manager.sources.opaque

View source

Opaque-Source Resolvers for FEAT-228 Data-Plane Authorization.

Per-type resource identifier extraction for non-SQL DataSource subclasses (Mongo, Iceberg, Delta, Airtable, Smartsheet). Each source type has a dedicated extraction strategy that returns a :class:PhysicalResources with source_type and source_id populated.

Resource identifier format (Spec §2): source:<type>:<identifier> (e.g. source:mongo:finance_db.transactions)

This module is imported lazily by the physical-resource resolver (:mod:parrot.tools.dataset_manager.sources.resolver) for any source type it does not handle directly. All source imports are conditional (wrapped in try/except ImportError) because Mongo, Iceberg, and Delta are optional dependencies.

Usage::

from parrot.tools.dataset_manager.sources.opaque import resolve_opaque_source

resources = resolve_opaque_source(mongo_source)
# resources.source_type = "mongo"
# resources.source_id  = "finance_db.transactions"

Alias DataSource

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

Alias PhysicalResources

Re-exported from parrot.tools.dataset_manager.sources.resolver.PhysicalResources.

Function resolve_opaque_source

Extract resource identifiers from non-SQL DataSource subclasses.

Uses isinstance dispatch per source type. All imports are conditional so missing optional dependencies cause a graceful fallback to an empty :class:PhysicalResources rather than an ImportError.

resolve_opaque_source(source: 'DataSource') -> 'PhysicalResources'

Parameter Type Default Description
source 'DataSource' Any :class:~parrot.tools.dataset_manager.sources.base.DataSource subclass. SQL sources are not handled here; they belong to the main resolver.

Returns: 'PhysicalResources' — class:PhysicalResources with source_type and source_id populated for known source types, or empty for unrecognised types.

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