Transformation
Summary​
A Tecton Transformation. Transformations are used encapsulate and share transformation logic between Feature Views.Â
Use the
tecton.transformation
decorator to create a Transformation.
Attributes​
Name | Data Type | Description |
---|---|---|
created_at | Optional[datetime.datetime] | Returns the time that this Tecton object was created or last updated. None for locally defined objects. |
defined_in | Optional[str] | The repo filename where this object was declared. None for locally defined objects. |
description | Optional[str] | Returns the description of the Tecton object. |
id | str | Returns the unique id of the Tecton object. |
info | ||
mode | Transformation mode - Spark, Python, Pyspark, etc. | |
name | str | Returns the name of the Tecton object. |
owner | Optional[str] | Returns the owner of the Tecton object. |
prevent_destroy | If set to True, Tecton will block destructive actions taken on this Transformation. | |
tags | Dict[str, str] | Returns the tags of the Tecton object. |
transformation_mode | ||
transformer | The user function for this transformation. | |
workspace | Optional[str] | Returns the workspace that this Tecton object belongs to. None for locally defined objects. |
Methods​
Name | Description |
---|---|
__init__(...) | Creates a new Transformation. Use the @transformation decorator to create a Transformation instead of directly |
run(...) | Run the transformation against inputs. |
summary() | Displays a human-readable summary. |
validate() | Method is deprecated and will be removed in a future version. As of Tecton version 1.0, objects are validated upon object creation, so validation is unnecessary. |
__init__(...)​
Creates a new Transformation. Use the@transformation
decorator to create a Transformation instead of directly
using this constructor.Parameters
name
(str
) - A unique name of the Transformation.description
(Optional
[str
]) - A human-readable description.tags
(Union
[Dict
[str
,str
],NoneType
]) - Tags associated with this Tecton Transformation (key-value pairs of arbitrary metadata).owner
(Optional
[str
]) - Owner name (typically the email of the primary maintainer).prevent_destroy
(bool
) - If True, this Tecton object will be blocked from being deleted or re-created (i.e. a destructive update) during tecton plan/apply.mode
(str
) - The transformation mode. Valid values are "spark_sql", "pyspark", "snowflake_sql", "snowpark", "python", or "pandas".user_function
(Callable
[...
,Union
[str
,pyspark.sql.DataFrame
]]) - The user function for this transformation.options
(Union
[Dict
[str
,str
],NoneType
]) - Additional options to configure the Transformation. Used for advanced use cases and beta features. Default:None
run(...)​
Run the transformation against inputs.Â
Currently, this method only supports spark_sql, pyspark, and pandas modes.
Parameters
inputs
(Union
[pandas.DataFrame
,pandas.Series
,data_frame.TectonDataFrame
,pyspark.sql.DataFrame
,Dict
,str
,int
,float
,bool
]) - The positional arguments to the transformation function. For PySpark and SQL transformations, these are eitherpandas.DataFrame
orpyspark.sql.DataFrame
objects. For realtime transformations, these arepandas.Dataframe
objects.context
(MaterializationContext
) - An optional materialization context object. Default:None
Returns
Union
[TectonDataFrame
,Dict
]
summary()​
Displays a human-readable summary.validate()​
Method is deprecated and will be removed in a future version. As of Tecton version 1.0, objects are validated upon object creation, so validation is unnecessary.Returns
None