transform_convert_timestamp
TransformConvertTimestampAction
¶
Bases: PipelineAction
This action performs timestamp based conversions.
Example
Source code in src/cloe_nessy/pipeline/actions/transform_convert_timestamp.py
run(context, *, columns=None, source_format='', target_format='', **_)
¶
Converts column(s) from a given source format to a new format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
PipelineContext
|
Context in which this Action is executed. |
required |
columns
|
list[str] | str | None
|
A column name or a list of column names that should be converted. |
None
|
source_format
|
str
|
Initial format type of the column. |
''
|
target_format
|
str
|
Desired format type of the column.
This also supports passing a format string like |
''
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If no column, source_format or target_format are provided. |
ValueError
|
If source_format or target_format are not supported. |
Returns:
| Name | Type | Description |
|---|---|---|
PipelineContext |
PipelineContext
|
Context after the execution of this Action. |