manager
manager ¶
DomoDataflow Actions Manager
This module provides the DomoDataflow_Actions manager class for handling dataflow actions with computed properties for analysis and filtering.
DomoDataflow_Actions
dataclass
¶
DomoDataflow_Actions(
auth: DomoAuth,
dataflow: DomoDataflowProtocol,
dataflow_id: str,
actions: list[DomoDataflow_Action_Base] = list(),
)
Manager class for dataflow actions.
This class wraps the actions list from a dataflow and provides computed properties for filtering and analysis.
Attributes:
| Name | Type | Description |
|---|---|---|
auth |
DomoAuth
|
DomoAuth instance from parent dataflow |
dataflow |
DomoDataflowProtocol
|
Reference to parent DomoDataflow |
dataflow_id |
str
|
ID of the parent dataflow |
actions |
list[DomoDataflow_Action_Base]
|
List of action objects |
Example
dataflow = await DomoDataflow.get_by_id(auth=auth, dataflow_id=123) await dataflow.Actions.get() print(f"Has data science tiles: {dataflow.Actions.has_datascience_tiles}") print(f"Input datasets: {dataflow.Actions.input_datasets}")
action_type_counts
property
¶
action_type_counts: dict[str, int]
Get count of actions by action type.
Returns:
| Type | Description |
|---|---|
dict[str, int]
|
Dictionary mapping action_type to count |
Example
counts = dataflow.Actions.action_type_counts for action_type, count in counts.items(): ... print(f"{action_type}: {count}")
column_relationships
property
¶
column_relationships: set[ColumnRelationship]
Aggregate column-level lineage across all actions.
Collects ColumnRelationships from every action's column_relationships property and returns the union.
Example
rels = dataflow.Actions.column_relationships print(f"Found {len(rels)} column relationships")
datascience_tiles
property
¶
datascience_tiles: list[DomoDataflow_Action_Base]
Get list of data science actions.
Returns:
| Type | Description |
|---|---|
list[DomoDataflow_Action_Base]
|
Filtered list of data science actions |
Example
ds_tiles = dataflow.Actions.datascience_tiles print(f"Found {len(ds_tiles)} data science tiles")
disabled_actions
property
¶
disabled_actions: list[DomoDataflow_Action_Base]
Get list of disabled actions.
Returns:
| Type | Description |
|---|---|
list[DomoDataflow_Action_Base]
|
Filtered list of disabled actions |
Example
disabled = dataflow.Actions.disabled_actions print(f"Found {len(disabled)} disabled actions")
has_datascience_tiles
property
¶
has_datascience_tiles: bool
Check if the dataflow has any data science tiles.
Returns:
| Type | Description |
|---|---|
bool
|
True if any action is a data science tile, False otherwise |
Example
if dataflow.Actions.has_datascience_tiles: ... print("This dataflow uses data science operations")
input_datasets
property
¶
input_datasets: list[dict[str, Any]]
Get list of input datasets (LoadFromVault actions).
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
List of dicts with 'id' and 'name' keys for each input dataset |
Example
for ds in dataflow.Actions.input_datasets: ... print(f"Input: {ds['name']} ({ds['id']})")
output_datasets
property
¶
output_datasets: list[dict[str, Any]]
Get list of output datasets (PublishToVault/WriteToVault actions).
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
List of dicts with 'id' and 'name' keys for each output dataset |
Example
for ds in dataflow.Actions.output_datasets: ... print(f"Output: {ds['name']} ({ds['id']})")
tile_type_counts
property
¶
tile_type_counts: dict[str, int]
Get count of actions by tile type.
Returns:
| Type | Description |
|---|---|
dict[str, int]
|
Dictionary mapping tile_type to count |
Example
counts = dataflow.Actions.tile_type_counts for tile_type, count in counts.items(): ... print(f"{tile_type}: {count}")
topo_sorted
property
¶
topo_sorted: list[DomoDataflow_Action_Base]
Return actions in topological (dependency) order.
Uses the same Kahn's-algorithm sort as convert_entire_workflow_to_sql_tiles
so callers get a stable, reproducible ordering that respects dependsOn edges.
Example
for action in dataflow.Actions.topo_sorted: ... print(action.name)
add_action ¶
add_action(obj: dict) -> DomoDataflow_Action_Base
Create a typed action from a raw dict and append it to this manager.
Uses polymorphic dispatch on DomoDataflow_Action_Base.from_dict() so the returned object is the correct concrete subclass.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
dict
|
Raw action dict (e.g. from to_action_dict()) |
required |
Returns:
| Type | Description |
|---|---|
DomoDataflow_Action_Base
|
The newly created typed action (already appended to self.actions) |
Example
new_dict = existing_pub.to_action_dict(upstream_id=..., output_name=...) new_action = defn.Actions.add_action(new_dict) tile = new_action.to_canvas_tile()
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | |
convert_entire_workflow_to_sql ¶
convert_entire_workflow_to_sql() -> list[dict[str, Any]]
Alias of convert_entire_workflow_to_sql_tiles().
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
540 541 542 | |
convert_entire_workflow_to_sql_tiles ¶
convert_entire_workflow_to_sql_tiles() -> (
list[dict[str, Any]]
)
Convert the full workflow into ordered SQL tile approximations.
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
List of tile conversion payloads with SQL, status, and dependencies. |
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
530 531 532 533 534 535 536 537 538 | |
convert_tile_to_sql ¶
convert_tile_to_sql(
action_id: str,
) -> dict[str, Any] | None
Convert a single tile/action to SQL with dependency context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action_id
|
str
|
The tile/action ID to convert. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
A conversion dict for the matching tile, or None if not found. |
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
515 516 517 518 519 520 521 522 523 524 525 526 527 528 | |
from_parent
classmethod
¶
from_parent(
parent: DomoDataflowProtocol,
actions: list[DomoDataflow_Action_Base] | None = None,
) -> DomoDataflow_Actions
Create an Actions manager from a parent dataflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
DomoDataflowProtocol
|
Parent DomoDataflow instance |
required |
actions
|
list[DomoDataflow_Action_Base] | None
|
Optional initial list of actions |
None
|
Returns:
| Type | Description |
|---|---|
DomoDataflow_Actions
|
DomoDataflow_Actions instance |
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
get
async
¶
get(
session: AsyncClient | None = None,
debug_api: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> list[DomoDataflow_Action_Base]
Get actions from the dataflow definition.
This method fetches the latest dataflow definition and populates the actions list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AsyncClient | None
|
Optional httpx client session |
None
|
debug_api
|
bool
|
Enable debug logging for API calls |
False
|
context
|
RouteContext | None
|
Optional RouteContext for the request |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
list[DomoDataflow_Action_Base]
|
List of action objects |
Example
actions = await dataflow.Actions.get() for action in actions: ... print(f"{action.name}: {action.action_type}")
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
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 127 128 129 130 131 132 133 | |
get_action_by_id ¶
get_action_by_id(
action_id: str,
) -> DomoDataflow_Action_Base | None
Get an action by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action_id
|
str
|
ID of the action to find |
required |
Returns:
| Type | Description |
|---|---|
DomoDataflow_Action_Base | None
|
The action object, or None if not found |
Example
action = dataflow.Actions.get_action_by_id("abc123") if action: ... print(f"Found action: {action.name}")
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | |
get_actions_by_type ¶
get_actions_by_type(
action_type: str,
) -> list[DomoDataflow_Action_Base]
Get all actions of a specific type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action_type
|
str
|
The action type to filter by (e.g., "Filter", "GroupBy") |
required |
Returns:
| Type | Description |
|---|---|
list[DomoDataflow_Action_Base]
|
List of actions matching the type |
Example
filters = dataflow.Actions.get_actions_by_type("Filter") print(f"Found {len(filters)} filter actions")
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |
get_script_content ¶
get_script_content(action_id: str) -> str | None
Extract script content from Python, R, or SQL script tiles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action_id
|
str
|
ID of the action to extract script from |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Script content as string, or None if not a script tile or script not found |
Example
script = dataflow.Actions.get_script_content("abc123") if script: ... print(script)
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
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 | |
remove_action ¶
remove_action(
action_id: str,
) -> DomoDataflow_Action_Base | None
Remove an action by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action_id
|
str
|
ID of the action to remove. |
required |
Returns:
| Type | Description |
|---|---|
DomoDataflow_Action_Base | None
|
The removed action, or None if not found. |
Example::
removed = defn.Actions.remove_action("MergeJoin-abc123")
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | |
remove_actions_by_type ¶
remove_actions_by_type(
action_type: str,
) -> list[DomoDataflow_Action_Base]
Remove all actions of a given type.
Idempotent — safe to call repeatedly (returns empty list on second call).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action_type
|
str
|
The action type string to remove (e.g., "SplitJoin"). |
required |
Returns:
| Type | Description |
|---|---|
list[DomoDataflow_Action_Base]
|
List of removed actions. |
Example::
removed = defn.Actions.remove_actions_by_type("SplitJoin")
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 | |
remove_actions_where ¶
remove_actions_where(
predicate,
) -> list[DomoDataflow_Action_Base]
Remove all actions matching a predicate.
Idempotent — safe to call repeatedly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
predicate
|
Callable accepting a DomoDataflow_Action_Base and returning True for actions to remove. |
required |
Returns:
| Type | Description |
|---|---|
list[DomoDataflow_Action_Base]
|
List of removed actions. |
Example::
removed = defn.Actions.remove_actions_where(
lambda a: a.action_type == "PublishToVault" and a.name == "MetaData_Pages_NoStats"
)
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | |
to_erd ¶
to_erd(
*,
title: str | None = None,
trace_from_entity: str | None = None,
trace_from_column: str | None = None
) -> MermaidERDiagram
Generate a Mermaid ER diagram from column relationships.
Collects column relationships from all actions and converts them to an ER diagram showing column-level lineage between tiles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str | None
|
Optional diagram title (defaults to dataflow name) |
None
|
trace_from_entity
|
str | None
|
If provided, trace only the upstream chain from this entity (e.g., a tile ID) |
None
|
trace_from_column
|
str | None
|
If provided, trace only the upstream chain for this specific column (e.g., "Revenue") |
None
|
Returns:
| Type | Description |
|---|---|
MermaidERDiagram
|
MermaidERDiagram with entities and relationships |
Example
Full dataflow ERD¶
diagram = dataflow.Actions.to_erd()
Trace a specific column upstream¶
diagram = dataflow.Actions.to_erd( ... trace_from_entity="publish-1", ... trace_from_column="Revenue", ... )
Source code in src/crew_dcs/classes/DomoDataflow/action/manager.py
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 | |