Skip to content

history

history

DomoDataflow_History dataclass

DomoDataflow_History(
    auth: DomoAuth,
    dataflow_id: str,
    dataflow: Any = None,
    execution_history: (
        list[DomoDataflow_History_Execution] | None
    ) = None,
)

get_execution_history async

get_execution_history(
    auth: DomoAuth | None = None,
    maximum: int = 10,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> list[DomoDataflow_History_Execution]

retrieves metadata about execution history. includes details like execution status.

Source code in src/crew_dcs/classes/DomoDataflow/history.py
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
async def get_execution_history(
    self,
    auth: DomoAuth | None = None,
    maximum: int = 10,  # maximum number of execution histories to retrieve
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> list[DomoDataflow_History_Execution]:
    """retrieves metadata about execution history.
    includes details like execution status.
    """

    auth = auth or self.auth or self.dataflow.auth

    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    res = await dataflow_routes.get_dataflow_execution_history(
        auth=auth,
        dataflow_id=self.dataflow_id,
        maximum=maximum,
        context=context,
    )

    if return_raw:
        return res

    execution_history = [
        DomoDataflow_History_Execution.from_dict(df_obj, auth)
        for df_obj in res.response
    ]

    await ce.gather_with_concurrency(
        *[
            domo_execution.get_actions(context=context)
            for domo_execution in execution_history
        ],
        n=20,
    )

    self.execution_history = execution_history

    return self.execution_history

DomoDataflow_History_Execution dataclass

DomoDataflow_History_Execution(
    auth: DomoAuth,
    id: str,
    dataflow_id: str,
    dataflow_execution_id: str,
    dataflow_version: str,
    is_failed: bool,
    state: str,
    activation_type: str,
    data_processor: str,
    telemetry: dict,
    execution_stats: dict,
    begin_time: datetime | None = None,
    last_updated: datetime | None = None,
    end_time: datetime | None = None,
    action_results: (
        list[DomoDataflow_ActionResult] | None
    ) = None,
)

get_actions async

get_actions(
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> list[DomoDataflow_ActionResult]

retrieves details execution action results

Source code in src/crew_dcs/classes/DomoDataflow/history.py
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
async def get_actions(
    self,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> list[DomoDataflow_ActionResult]:
    """retrieves details execution action results"""

    base_context = RouteContext.build_context(
        parent_class=self.__class__.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    res = await dataflow_routes.get_dataflow_execution_by_id(
        auth=self.auth,
        dataflow_id=self.dataflow_id,
        execution_id=self.id,
        context=context,
    )

    if return_raw:
        return res

    self.action_results = self._process_results(
        res.response.get("actionResults", [])
    )

    return self.action_results

get_by_id async classmethod

get_by_id(
    auth: DomoAuth,
    dataflow_id: int,
    execution_id: int,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> DomoDataflow_History_Execution

retrieves details about a dataflow execution including actions

Source code in src/crew_dcs/classes/DomoDataflow/history.py
 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
@classmethod
async def get_by_id(
    cls,
    auth: DomoAuth,
    dataflow_id: int,
    execution_id: int,
    return_raw: bool = False,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> DomoDataflow_History_Execution:
    """retrieves details about a dataflow execution including actions"""

    base_context = RouteContext.build_context(
        parent_class=cls.__name__,
        **context_kwargs,
    )
    context = RouteContext.build_context(context=context or base_context)

    res = await dataflow_routes.get_dataflow_execution_by_id(
        auth=auth,
        dataflow_id=dataflow_id,
        execution_id=execution_id,
        context=context,
    )

    if return_raw:
        return res

    return cls.from_dict(auth=auth, de_obj=res.response)