registry
registry ¶
Lineage registry — decorators, registries, and import maps.
Extracted from base.py for separation of concerns. Contains: - PublisherResolution dataclass - FederatedLineageAuthRequiredError - Lineage type registry (register_lineage_type, get_lineage_type) - Lineage class registry (register_lineage, _try_register_lineage) - Import map for lazy registration
FederatedLineageAuthRequiredError ¶
FederatedLineageAuthRequiredError(
*,
entity_id: str,
entity_type: str,
domo_instance: str | None,
partial_lineage: list[DomoLineage_Link] | None = None
)
Bases: ClassError
Raised when federated lineage is requested without publisher auth.
.. deprecated::
This exception is no longer raised internally. Partial-lineage
situations are now handled by logging a warning instead.
Kept for backward-compatible except clauses in downstream code.
Source code in src/crew_dcs/classes/subentity/lineage/registry.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
PublisherResolution
dataclass
¶
PublisherResolution(
entity: Any | None = None,
intermediate_entities: list[Any] = list(),
)
Result of resolving a publisher entity, with optional intermediate entities.
Attributes:
| Name | Type | Description |
|---|---|---|
entity |
Any | None
|
The resolved publisher-side entity (e.g., a card or dataset), or None. |
intermediate_entities |
list[Any]
|
Entities between the publication and the resolved entity in the lineage chain (e.g., a page when a card is published indirectly as part of a page). |
get_lineage_type ¶
get_lineage_type(class_name: str) -> str
Get the lineage type string for a given class name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
class_name
|
str
|
The class name to look up |
required |
Returns:
| Type | Description |
|---|---|
str
|
The lineage type string (e.g., "DATAFLOW", "DATA_SOURCE") |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the class name is not registered |
Source code in src/crew_dcs/classes/subentity/lineage/registry.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
register_lineage ¶
register_lineage(*parent_class_names: str)
Decorator to register a DomoLineage subclass for parent class names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*parent_class_names
|
str
|
One or more parent class names that should use this lineage class |
()
|
Example
@register_lineage("DomoPage", "DomoPage_Default") @dataclass class DomoLineage_Page(DomoLineage): ...
Source code in src/crew_dcs/classes/subentity/lineage/registry.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
register_lineage_type ¶
register_lineage_type(*class_names: str, lineage_type: str)
Decorator to register lineage type for entity classes.
.. deprecated:: Direct use of @register_lineage_type is deprecated. Entity classes should set entity_type: ClassVar[str] on the class instead — init_subclass on DomoEntity auto-registers lineage types when has_lineage=True. This decorator is kept for backward compatibility and is called internally by the auto-registration system.
This decorator registers one or more entity class names with their corresponding lineage type string (e.g., "DATAFLOW", "DATA_SOURCE", "PAGE").
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*class_names
|
str
|
One or more class names that should use this lineage type |
()
|
lineage_type
|
str
|
The lineage type string (e.g., "DATAFLOW", "DATA_SOURCE") |
required |
Example
@register_lineage_type("DomoDataflow", lineage_type="DATAFLOW") @dataclass class DomoDataflow(DomoEntity_w_Lineage): ...
Source code in src/crew_dcs/classes/subentity/lineage/registry.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |