Skip to content

view

view

DomoDatasetView - A dataset view that references a parent dataset

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.

is_view property

is_view: bool

Check if this dataset is a view.

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
@classmethod
def from_dict(
    cls,
    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.

    Args:
        auth: Authentication object
        obj: Dataset metadata dictionary
        is_use_default_dataset_class: Whether to use default class (ignored for views)
        new_cls: Alternative class to use (ignored for views)
        **kwargs: Additional keyword arguments

    Returns:
        DomoDatasetView instance

    Note:
        Parent dataset ID should be retrieved from lineage, not stored on the entity.
    """
    # Create the view instance using parent's from_dict
    view = super().from_dict(
        auth=auth,
        obj=obj,
        is_use_default_dataset_class=True,
        new_cls=cls,
        **kwargs,
    )

    return view  # noqa: RET504

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
async def get_parent_dataset(
    self,
    debug_api: bool = False,
    session: httpx.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.

    Args:
        debug_api: Enable API debugging
        session: HTTP client session (optional)

    Returns:
        The parent dataset instance, or None if not found
    """
    if self._parent_dataset:
        return self._parent_dataset

    # Get parent dataset from lineage using lineage subclass method
    # For views, the parent dataset should be in the immediate lineage
    await self.Lineage.get(
        debug_api=debug_api,
        session=session,
        max_depth=1,  # Just immediate lineage to find parent
    )

    parent_item = self.Lineage.get_parent_dataset()

    if parent_item:
        self._parent_dataset = parent_item
        return self._parent_dataset

    return None