ai_readiness_lineage
ai_readiness_lineage ¶
AI Readiness lineage auto-fill for DomoDataset.
Provides lineage-aware auto-population of AI Readiness assessments by tracing upstream and downstream dependencies and generating human-readable context descriptions.
Data Models
LineageEntityInfo: Summary of a lineage entity for AI Readiness AIReadinessLineageReport: Complete lineage report for an AI Readiness assessment
Core Functions
generate_lineage_report: Trace upstream and downstream lineage for a dataset auto_fill_lineage_context: Auto-fill AI Readiness context based on lineage batch_populate_lineage: Populate lineage for multiple datasets in parallel
AIReadinessLineageReport
dataclass
¶
AIReadinessLineageReport(
dataset_id: str,
dataset_name: str,
upstream_datasets: list[LineageEntityInfo] = list(),
upstream_dataflows: list[LineageEntityInfo] = list(),
downstream_cards: list[LineageEntityInfo] = list(),
downstream_datasets: list[LineageEntityInfo] = list(),
downstream_pages: list[LineageEntityInfo] = list(),
)
Complete lineage report for an AI Readiness assessment.
Attributes:
| Name | Type | Description |
|---|---|---|
dataset_id |
str
|
ID of the dataset this report is for |
dataset_name |
str
|
Display name of the dataset |
upstream_datasets |
list[LineageEntityInfo]
|
Source datasets that feed into this dataset |
upstream_dataflows |
list[LineageEntityInfo]
|
Dataflows that produce this dataset |
downstream_cards |
list[LineageEntityInfo]
|
Cards that depend on this dataset |
downstream_datasets |
list[LineageEntityInfo]
|
Downstream datasets (e.g., views) that depend on this dataset |
downstream_pages |
list[LineageEntityInfo]
|
Pages that contain cards using this dataset |
to_description ¶
to_description() -> str
Generate a natural language description for AI Readiness context field.
Produces a human-readable paragraph summarizing the dataset's lineage, suitable for use as the AI Readiness description field.
Returns:
| Type | Description |
|---|---|
str
|
A paragraph describing the dataset's lineage context |
Source code in src/crew_dcs/classes/DomoDataset/ai_readiness_lineage.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
to_dict ¶
to_dict() -> dict
Convert to dictionary format.
Source code in src/crew_dcs/classes/DomoDataset/ai_readiness_lineage.py
133 134 135 136 137 138 139 140 141 142 143 | |
LineageEntityInfo
dataclass
¶
LineageEntityInfo(
id: str,
name: str,
type: str,
description: str | None = None,
)
Summary of a lineage entity for AI Readiness.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Entity identifier |
name |
str
|
Display name of the entity |
type |
str
|
Entity type string (DATA_SOURCE, DATAFLOW, CARD, PAGE) |
description |
str | None
|
Optional description of the entity |
to_dict ¶
to_dict() -> dict
Convert to dictionary format.
Source code in src/crew_dcs/classes/DomoDataset/ai_readiness_lineage.py
63 64 65 66 67 68 69 70 | |
auto_fill_lineage_context
async
¶
auto_fill_lineage_context(
auth: DomoAuth,
dataset_id: str,
max_depth: int = 5,
*,
context: RouteContext | None = None
) -> DomoDataset_AI_Readiness
Auto-fill AI Readiness context based on lineage.
- Generate lineage report
- Get or create AI Readiness assessment
- Update the description field with lineage context
- Update column descriptions where possible (e.g., mark columns as "upstream from {dataset_name}")
- Return the updated AI Readiness object
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
dataset_id
|
str
|
ID of the dataset |
required |
max_depth
|
int
|
Maximum lineage depth for upstream traversal (default: 5) |
5
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
Returns:
| Type | Description |
|---|---|
DomoDataset_AI_Readiness
|
Updated DomoDataset_AI_Readiness with lineage context populated |
Source code in src/crew_dcs/classes/DomoDataset/ai_readiness_lineage.py
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 | |
batch_populate_lineage
async
¶
batch_populate_lineage(
auth: DomoAuth,
dataset_ids: list[str],
max_depth: int = 5,
*,
context: RouteContext | None = None
) -> dict[str, AIReadinessLineageReport]
Populate lineage for multiple datasets in parallel.
Uses gather_with_concurrency for efficient batch processing. Returns dict mapping dataset_id to lineage report.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
dataset_ids
|
list[str]
|
List of dataset IDs to process |
required |
max_depth
|
int
|
Maximum lineage depth for upstream traversal (default: 5) |
5
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, AIReadinessLineageReport]
|
Dictionary mapping dataset_id to AIReadinessLineageReport |
Source code in src/crew_dcs/classes/DomoDataset/ai_readiness_lineage.py
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | |
generate_lineage_report
async
¶
generate_lineage_report(
auth: DomoAuth,
dataset_id: str,
max_depth: int = 5,
include_downstream: bool = True,
*,
context: RouteContext | None = None
) -> AIReadinessLineageReport
Trace upstream and downstream lineage for a dataset.
- Fetch the dataset metadata for name
- Get upstream lineage (source datasets and dataflows)
- Get downstream lineage (dependent cards, datasets, pages)
- Return structured report
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
dataset_id
|
str
|
ID of the dataset to trace |
required |
max_depth
|
int
|
Maximum lineage depth for upstream traversal (default: 5) |
5
|
include_downstream
|
bool
|
Whether to include downstream dependents (default: True) |
True
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
Returns:
| Type | Description |
|---|---|
AIReadinessLineageReport
|
AIReadinessLineageReport with categorized lineage information |
Source code in src/crew_dcs/classes/DomoDataset/ai_readiness_lineage.py
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 | |