pivot
pivot ¶
DomoDataflow Pivot Actions
Pivot and unpivot actions for reshaping data in Magic ETL v2. These correspond to the "Pivot" category in the Domo ETL UI sidebar.
DomoDataflow_Action_Denormalizer
dataclass
¶
DomoDataflow_Action_Denormalizer(
id: str,
action_type: str = None,
tile_type: str | None = None,
name: str = None,
depends_on: list[str] = None,
disabled: bool = False,
gui: dict = None,
settings: dict = None,
raw: dict = None,
parent_actions: list[DomoDataflow_Action_Base] = None,
key_field: str = None,
group: list[dict] = None,
fields: list[dict] = None,
input: str = None,
tables: list[dict] = None,
)
Bases: DomoDataflow_Action_Base
Denormaliser action - pivots rows to columns.
Also known as "Pivot" in the Magic ETL UI.
Attributes:
| Name | Type | Description |
|---|---|---|
key_field |
str
|
Column containing values to become column headers |
group |
list[dict]
|
Columns to group by |
fields |
list[dict]
|
Columns to pivot |
Example
pivot_action = dataflow.get_action_objects("Denormaliser")[0] print(f"Pivoting on '{pivot_action.key_field}'")
column_relationships
property
¶
column_relationships: set[ColumnRelationship]
Column relationships for Denormaliser (Pivot) tile.
Group columns → DIRECT/IDENTITY (passthrough) Key field → INDIRECT/GROUP_BY Pivot fields → DIRECT/TRANSFORMATION
DomoDataflow_Action_NormalizeAll
dataclass
¶
DomoDataflow_Action_NormalizeAll(
id: str,
action_type: str = None,
tile_type: str | None = None,
name: str = None,
depends_on: list[str] = None,
disabled: bool = False,
gui: dict = None,
settings: dict = None,
raw: dict = None,
parent_actions: list[DomoDataflow_Action_Base] = None,
id_fields: list[dict] = None,
key_field: str = None,
value_field: str = None,
input: str = None,
tables: list[dict] = None,
)
Bases: DomoDataflow_Action_Base
Normalize All action - unpivots all columns except ID columns.
Also known as "Dynamic Unpivot" in the Magic ETL UI.
Attributes:
| Name | Type | Description |
|---|---|---|
id_fields |
list[dict]
|
Columns to keep as identifiers (not unpivoted) |
key_field |
str
|
Name of the column for original column names |
value_field |
str
|
Name of the column for values |
Example
normalize_action = dataflow.get_action_objects("NormalizeAll")[0] print(f"ID columns: {normalize_action.id_columns}")
DomoDataflow_Action_Normalizer
dataclass
¶
DomoDataflow_Action_Normalizer(
id: str,
action_type: str = None,
tile_type: str | None = None,
name: str = None,
depends_on: list[str] = None,
disabled: bool = False,
gui: dict = None,
settings: dict = None,
raw: dict = None,
parent_actions: list[DomoDataflow_Action_Base] = None,
fields: list[dict] = None,
typefield: str = None,
input: str = None,
tables: list[dict] = None,
)
Bases: DomoDataflow_Action_Base
Normalizer action - unpivots columns to rows.
Also known as "Unpivot" in the Magic ETL UI.
Attributes:
| Name | Type | Description |
|---|---|---|
fields |
list[dict]
|
Columns to unpivot |
typefield |
str
|
Name of the column containing original column names |
Example
normalizer_action = dataflow.get_action_objects("Normalizer")[0] print(f"Unpivoting columns into '{normalizer_action.typefield}'")
column_relationships
property
¶
column_relationships: set[ColumnRelationship]
Column relationships for Normalizer (Unpivot) tile.
Unpivoted columns → DIRECT/TRANSFORMATION (multiple cols → key+value) typefield column → synthetic (no upstream column)