core
core ¶
a class based approach for interacting with Domo Datasets
DomoDataset
dataclass
¶
DomoDataset(
auth: DomoAuth,
id: str,
raw: dict,
display_type: str = "",
data_provider_type: str = "",
name: str = "",
description: str = "",
row_count: int | None = None,
column_count: int | None = None,
stream_id: int | None = None,
cloud_id: str | None = None,
last_touched_dt: datetime | None = None,
last_updated_dt: datetime | None = None,
created_dt: datetime | None = None,
owner: dict = dict(),
formulas: dict = dict(),
Data: DomoDataset_Data | None = None,
Schema: DomoDataset_Schema | None = None,
Stream: DomoStream | None = None,
Tags: DomoTags | None = None,
PDP: DatasetPdpPolicies | None = None,
Access: DomoDatasetAccessController | None = None,
Formulas: DomoDataset_FormulasManager | None = None,
Certification: DomoCertification | None = None,
AI_Readiness: DomoDataset_AI_Readiness | None = None,
_is_schedule_hydrated: bool = False,
)
Bases: DomoDataset_Default
from_dict
classmethod
¶
from_dict(
auth: DomoAuth,
obj: dict,
check_is_published: bool | None = None,
is_use_default_dataset_class: bool = False,
new_cls=None,
is_published: bool = False,
parent_auth_retrieval_fn: Callable | None = None,
parent_auth: DomoAuth | None = None,
**kwargs
) -> DomoDataset
Factory method that automatically detects the dataset type and returns the appropriate class: - DomoSemanticModel for data models (data-model) - DomoDatasetView for views (dataset-view) - DomoDataset for regular datasets
For federated datasets, use composition via dataset.Federation helper.
Source code in src/crew_dcs/classes/DomoDataset/core.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
get_by_id
async
classmethod
¶
get_by_id(
auth: DomoAuth,
dataset_id: str,
debug_api: bool = False,
return_raw: bool = False,
session: AsyncClient | None = None,
debug_num_stacks_to_drop: int = 2,
is_use_default_dataset_class: bool = False,
parent_class: str | None = None,
is_get_account: bool = True,
is_suppress_no_account_config: bool = True,
check_if_published: bool | None = None,
parent_auth_retrieval_fn: Callable | None = None,
parent_auth: DomoAuth | None = None,
max_subscriptions_to_check: int | None = None,
*,
context=None,
**context_kwargs
)
Retrieve dataset metadata by ID.
This method uses the factory pattern in from_dict() to automatically return the appropriate dataset class (DomoDatasetView or DomoDataset) based on the dataset metadata.
If parent_auth or parent_auth_retrieval_fn is provided and check_if_published is not explicitly False, check_if_published will be automatically set to True.
Source code in src/crew_dcs/classes/DomoDataset/core.py
73 74 75 76 77 78 79 80 81 82 83 84 85 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 126 | |
DomoDatasetView
dataclass
¶
DomoDatasetView(
auth: DomoAuth,
id: str,
raw: dict,
display_type: str = "",
data_provider_type: str = "",
name: str = "",
description: str = "",
row_count: int | None = None,
column_count: int | None = None,
stream_id: int | None = None,
cloud_id: str | None = None,
last_touched_dt: datetime | None = None,
last_updated_dt: datetime | None = None,
created_dt: datetime | None = None,
owner: dict = dict(),
formulas: dict = dict(),
Data: DomoDataset_Data | None = None,
Schema: DomoDataset_Schema | None = None,
Stream: DomoStream | None = None,
Tags: DomoTags | None = None,
PDP: DatasetPdpPolicies | None = None,
Access: DomoDatasetAccessController | None = None,
Formulas: DomoDataset_FormulasManager | None = None,
Certification: DomoCertification | None = None,
AI_Readiness: DomoDataset_AI_Readiness | None = None,
_is_schedule_hydrated: bool = False,
_parent_dataset: Any = None,
Definition: (
DomoDatasetView_DefinitionManager | None
) = None,
)
Bases: DomoDataset_Default
A dataset view that references a parent dataset.
Views are derived datasets that are based on another dataset. They cannot exist without a parent dataset.
The parent dataset ID should be retrieved from lineage, not stored on the entity.
from_dict
classmethod
¶
from_dict(
auth: DomoAuth,
obj: dict[str, Any],
is_use_default_dataset_class: bool = True,
new_cls=None,
**kwargs
) -> DomoDatasetView
Create a DomoDatasetView instance from API response dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object |
required |
obj
|
dict[str, Any]
|
Dataset metadata dictionary |
required |
is_use_default_dataset_class
|
bool
|
Whether to use default class (ignored for views) |
True
|
new_cls
|
Alternative class to use (ignored for views) |
None
|
|
**kwargs
|
Additional keyword arguments |
{}
|
Returns:
| Type | Description |
|---|---|
DomoDatasetView
|
DomoDatasetView instance |
Note
Parent dataset ID should be retrieved from lineage, not stored on the entity.
Source code in src/crew_dcs/classes/DomoDataset/view.py
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 126 127 128 | |
get_parent_dataset
async
¶
get_parent_dataset(
debug_api: bool = False,
session: AsyncClient | None = None,
) -> DomoDataset_Default | None
Get the parent dataset for this view from lineage.
For views, the parent dataset is included in the lineage. This method retrieves it from the lineage rather than storing it on the entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
debug_api
|
bool
|
Enable API debugging |
False
|
session
|
AsyncClient | None
|
HTTP client session (optional) |
None
|
Returns:
| Type | Description |
|---|---|
DomoDataset_Default | None
|
The parent dataset instance, or None if not found |
Source code in src/crew_dcs/classes/DomoDataset/view.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
DomoDataset_Default
dataclass
¶
DomoDataset_Default(
auth: DomoAuth,
id: str,
raw: dict,
display_type: str = "",
data_provider_type: str = "",
name: str = "",
description: str = "",
row_count: int | None = None,
column_count: int | None = None,
stream_id: int | None = None,
cloud_id: str | None = None,
last_touched_dt: datetime | None = None,
last_updated_dt: datetime | None = None,
created_dt: datetime | None = None,
owner: dict = dict(),
formulas: dict = dict(),
Data: DomoDataset_Data | None = None,
Schema: DomoDataset_Schema | None = None,
Stream: DomoStream | None = None,
Tags: DomoTags | None = None,
PDP: DatasetPdpPolicies | None = None,
Access: DomoDatasetAccessController | None = None,
Formulas: DomoDataset_FormulasManager | None = None,
Certification: DomoCertification | None = None,
AI_Readiness: DomoDataset_AI_Readiness | None = None,
_is_schedule_hydrated: bool = False,
)
Bases: DomoEntity_w_Lineage
interacts with domo datasets
is_federated
property
¶
is_federated: bool
Heuristic: decide if a dataset JSON represents a federated (proxy) dataset.
is_manual
property
¶
is_manual: bool
True when composed schedule resolves to manual execution.
This property is strict by design: callers must either hydrate schedule state first or use async helpers that auto-hydrate.
is_schedule_hydrated
property
¶
is_schedule_hydrated: bool
Whether schedule state has been explicitly hydrated from stream metadata.
is_scheduled
property
¶
is_scheduled: bool
True when composed schedule resolves to scheduled execution.
transport_type
property
¶
transport_type: str | None
Get the transport type of the dataset if available.
Returns None if transport type cannot be determined rather than raising an exception. This allows the property to be safely included in serialization.
duplicate
async
¶
duplicate(
new_name: str | None = None,
*,
new_description: str | None = None,
override_data_provider_key: str | None = None,
override_transport_description: str | None = None,
override_configuration: list[dict] | None = None,
override_account_id: int | None = None,
is_execute: bool = False,
context: RouteContext | None = None,
**context_kwargs
) -> DomoDataset_Default
Duplicate this dataset by creating a new stream+dataset with the same connector config.
Creates a new dataset with the same connector type and configuration as this dataset. Optionally overrides the connector at creation time (useful for creating a dataset with a different connector from the start).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_name
|
str | None
|
Name for the new dataset. Defaults to "{current_name} (Copy)". |
None
|
new_description
|
str | None
|
Description for the new dataset. Defaults to current description. |
None
|
override_data_provider_key
|
str | None
|
Override the connector type for the new dataset. Defaults to current stream's dataProvider.key. |
None
|
override_transport_description
|
str | None
|
Override the transport description. Defaults to current stream's transport.description. |
None
|
override_configuration
|
list[dict] | None
|
Override the stream configuration. Defaults to current stream's configuration. |
None
|
override_account_id
|
int | None
|
Account ID for connectors requiring auth. |
None
|
is_execute
|
bool
|
If True, run the stream immediately after creation. |
False
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration. |
None
|
**context_kwargs
|
Additional context parameters. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
DomoDataset_Default |
DomoDataset_Default
|
The newly created dataset (hydrated). |
Raises:
| Type | Description |
|---|---|
ValueError
|
If this dataset has no stream (cannot duplicate non-connector datasets this way). |
Stream_CRUD_Error
|
If stream creation fails. |
Example
ds = await DomoDataset.get_by_id(auth, dataset_id="abc123")
Simple duplicate with same connector¶
new_ds = await ds.duplicate()
Duplicate with a different connector¶
new_ds = await ds.duplicate( ... new_name="My Dataset (DomoStats)", ... override_data_provider_key="domostats", ... override_transport_description="com.domo.connector.domostats", ... override_configuration=[ ... {"name": "report", "value": "cards", "type": "string"}, ... ], ... is_execute=True, ... )
Note
Some built-in connectors (like domostats) may reuse existing streams when creating via POST /api/data/v1/streams. If you need a guaranteed new stream, use a connector that creates fresh streams (e.g. governance, third-party connectors).
Source code in src/crew_dcs/classes/DomoDataset/dataset_default.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 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 496 497 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 | |
get_by_id
async
classmethod
¶
get_by_id(
auth: DomoAuth,
dataset_id: str,
debug_api: bool = False,
return_raw: Literal[True] = True,
session: AsyncClient | None = None,
debug_num_stacks_to_drop: int = 2,
is_use_default_dataset_class: bool = False,
parent_class: str | None = None,
is_get_account: bool = True,
is_suppress_no_account_config: bool = True,
check_if_published: bool | None = None,
parent_auth_retrieval_fn: Callable | None = None,
parent_auth: DomoAuth | None = None,
max_subscriptions_to_check: int | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
get_by_id(
auth: DomoAuth,
dataset_id: str,
debug_api: bool = False,
return_raw: Literal[False] = False,
session: AsyncClient | None = None,
debug_num_stacks_to_drop: int = 2,
is_use_default_dataset_class: bool = False,
parent_class: str | None = None,
is_get_account: bool = True,
is_suppress_no_account_config: bool = True,
check_if_published: bool | None = None,
parent_auth_retrieval_fn: Callable | None = None,
parent_auth: DomoAuth | None = None,
max_subscriptions_to_check: int | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
) -> DomoDataset_Default
get_by_id(
auth: DomoAuth,
dataset_id: str,
debug_api: bool = False,
return_raw: bool = False,
session: AsyncClient | None = None,
debug_num_stacks_to_drop: int = 2,
is_use_default_dataset_class: bool = False,
parent_class: str | None = None,
is_get_account: bool = True,
is_suppress_no_account_config: bool = True,
check_if_published: bool | None = None,
parent_auth_retrieval_fn: Callable | None = None,
parent_auth: DomoAuth | None = None,
max_subscriptions_to_check: int | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
retrieves dataset metadata
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
dataset_id
|
str
|
Dataset identifier to fetch |
required |
debug_api
|
bool
|
Enable verbose API logging |
False
|
return_raw
|
bool
|
If True return the raw response object |
False
|
check_if_published
|
bool | None
|
When True attempt to resolve publish subscriptions. If None and either parent_auth or parent_auth_retrieval_fn is provided, defaults to True. |
None
|
parent_auth_retrieval_fn
|
Callable | None
|
Callable used to obtain publisher auth for publish checks |
None
|
parent_auth
|
DomoAuth | None
|
Pre-existing publisher auth (alternative to parent_auth_retrieval_fn) |
None
|
max_subscriptions_to_check
|
int | None
|
Optional limit passed to the PublishResolver |
None
|
Source code in src/crew_dcs/classes/DomoDataset/dataset_default.py
579 580 581 582 583 584 585 586 587 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 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 | |
get_is_manual
async
¶
get_is_manual() -> bool
Get manual/scheduled state with guaranteed schedule hydration.
Source code in src/crew_dcs/classes/DomoDataset/dataset_default.py
203 204 205 206 | |
get_is_scheduled
async
¶
get_is_scheduled() -> bool
Get scheduled state with guaranteed schedule hydration.
Source code in src/crew_dcs/classes/DomoDataset/dataset_default.py
208 209 210 211 | |
hydrate_schedule_state
async
¶
hydrate_schedule_state(
force_refresh: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> DomoDataset_Default
Hydrate schedule state for this dataset.
Search-index dataset payloads omit streamId and schedule fields, so this
method rehydrates dataset metadata by ID and fetches stream metadata when
available.
Source code in src/crew_dcs/classes/DomoDataset/dataset_default.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | |
to_dict ¶
to_dict(
override_fn: Callable | None = None,
return_snake_case: bool = False,
) -> dict
Serialize dataset and composed objects for export/debugging.
Source code in src/crew_dcs/classes/DomoDataset/dataset_default.py
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | |
update_properties
async
¶
update_properties(
name: str | None = None,
description: str | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
Update this datasource's name and/or description.
Applies to datasets, dataset views, and data models alike. Updates the
local name/description on success.
Source code in src/crew_dcs/classes/DomoDataset/dataset_default.py
797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 | |
DomoSemanticModel
dataclass
¶
DomoSemanticModel(
auth: DomoAuth,
id: str,
raw: dict,
display_type: str = "",
data_provider_type: str = "",
name: str = "",
description: str = "",
row_count: int | None = None,
column_count: int | None = None,
stream_id: int | None = None,
cloud_id: str | None = None,
last_touched_dt: datetime | None = None,
last_updated_dt: datetime | None = None,
created_dt: datetime | None = None,
owner: dict = dict(),
formulas: dict = dict(),
Data: DomoDataset_Data | None = None,
Schema: DomoDataset_Schema | None = None,
Stream: DomoStream | None = None,
Tags: DomoTags | None = None,
PDP: DatasetPdpPolicies | None = None,
Access: DomoDatasetAccessController | None = None,
Formulas: DomoDataset_FormulasManager | None = None,
Certification: DomoCertification | None = None,
AI_Readiness: DomoDataset_AI_Readiness | None = None,
_is_schedule_hydrated: bool = False,
Model: DomoSemanticModel_ModelManager | None = None,
)
Bases: DomoDataset_Default
A Domo data model (semantic layer datasource).
Joins multiple source datasets at query time. The tables and JOIN
criteria are exposed via the composed Model manager:
model = await DomoSemanticModel.get_by_id(auth=auth, dataset_id=...)
await model.Model.get()
model.Model.tables # source-dataset tables
model.Model.relationships # JOIN criteria
Upstream source datasets are available two ways: directly from the
definition (model.Model.source_dataset_ids) and via the inherited
Domo lineage API (model.Lineage).
from_dict
classmethod
¶
from_dict(
auth: DomoAuth,
obj: dict[str, Any],
is_use_default_dataset_class: bool = True,
new_cls=None,
**kwargs
) -> DomoSemanticModel
Create a DomoSemanticModel from an API response dictionary.
Source code in src/crew_dcs/classes/DomoDataset/semantic_model.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |