Spec model¶
The spec document and its cached declaration views.
Spec
¶
Bases: StrictModel
The complete JSON document with cached views of its declarations.
source
class-attribute
instance-attribute
¶
source: SpecSource = pydantic.Field(default_factory=lambda: SpecSource(name='manual', generated=False))
dimensions
class-attribute
instance-attribute
¶
functions
class-attribute
instance-attribute
¶
profiles
class-attribute
instance-attribute
¶
profile_items
cached
property
¶
Return profiles with their global IDs in declaration order.
profiles_by_key
cached
property
¶
Return profiles keyed by their globally unique IDs.
profile_keys
cached
property
¶
Return each global profile ID's declaration key.
features
cached
property
¶
Return original feature metadata keyed by ID, including dimensions.
operators
cached
property
¶
Return original Operator objects in declaration order, retaining aliases.
operator_items
cached
property
¶
Return operator occurrences with profile and dictionary keys.
operators_by_key
cached
property
¶
Return original Operators keyed by their declaration locations.
operator_profile_keys
cached
property
¶
Return each operator's owning profile ID.
operator_profiles
cached
property
¶
Return each operator's owning profile.
arguments
property
¶
Return function argument declarations keyed by function and argument.
entrypoints
property
¶
Return distinct catalog entrypoint strings in declaration order.
feature_owners
cached
property
¶
Return all occurrence keys owning each non-dimension feature.
operators_by_function
cached
property
¶
Return operator occurrence keys grouped by function ID.
feature_producers
cached
property
¶
Return all operator occurrence keys declaring each output feature.
dimensions_by_profile
cached
property
¶
Return each profile's dimension IDs.
identifiers_by_profile
cached
property
¶
Return profile row identifiers in grain order.
identifier_types_by_profile
cached
property
¶
Return logical types for profile row identifiers.
relation_types_by_profile
cached
property
¶
Return logical types for declared relations, excluding identifiers.
key_types_by_profile
cached
property
¶
Return identifier and relation types together for physical assembly.
identifier_ids
cached
property
¶
Return all column names selected as profile row identifiers.
key_ids_by_profile
cached
property
¶
Return identifier and relation column names together for each profile.
key_ids
cached
property
¶
Return all declared identifier and relation column names.
operator_paths
cached
property
¶
Return model-ID paths used by operator contracts.
declaration_paths
cached
property
¶
Return dictionary-key paths used by binding validation.
local_features
cached
property
¶
Return column IDs available in each profile, including keys and relations.
input_candidates
cached
property
¶
Return ordered input feature owners, preserving unresolved and ambiguous inputs.
input_sources
cached
property
¶
Return the unique source occurrence for each operator, or None when unresolved.
operator_dataframe_arguments
cached
property
¶
Return supplied dataframe arguments and their referenced profile IDs.
dataframe_argument_profiles
cached
property
¶
Return resolved profile keys for dataframe arguments in argument order.
dataframe_argument_profile_ids
cached
property
¶
Return distinct resolved profile IDs for each operator's dataframe arguments.
calculated_feature_producers
cached
property
¶
Return calculated feature IDs mapped to their owning profile and operator.
dataframe_argument_identifiers
cached
property
¶
Return dataframe keys available from each operator's referenced profiles.
binding_selectors_with_paths
cached
property
¶
Return binding leaves and argument types with their binding argument paths.
binding_arguments_with_paths
cached
property
¶
Return typed bound leaves with their binding-collection diagnostic paths.
binding_resources
cached
property
¶
Return declaration metadata available to structural binding selectors.
matching_profile_keys
cached
property
¶
Return selected matching profile keys and their declaration paths.
model_post_init
¶
Collect declarations for explicitly selected builtin merge bindings.
validate_supported_version
classmethod
¶
Reject obsolete documents with actionable rebuild guidance.
rebuild
¶
Return a fresh Spec after declarations have been edited.
Cached views on this instance are not invalidated when nested declarations change. Rebuild before validating or compiling an edited document.
get_row_context_profile
¶
Return the context profile, or None when its source is unresolved.
get_row_context_dimensions
¶
Return context profile dimension IDs, or None for an unresolved source.
get_row_context_resolution
¶
get_row_context_resolution(key: OperatorKey, dimension_id: str) -> dimension_module.Resolution | None
Return the selected context resolution, or None when it is unavailable.
grain_refines
¶
Return whether the finer profile selects descendants of every coarser key.
validate_spec_version_type
classmethod
¶
Reject booleans, which Python otherwise treats as integer literals.
normalize_document
classmethod
¶
Recover keyed resource IDs and resolve profile dimension references.
get_dimensions
classmethod
¶
Return raw dimension declarations from a document.
get_functions
classmethod
¶
Return raw function declarations from a document.
get_profiles
classmethod
¶
Return raw profile declarations from a document.