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() | [Deprecated in SDK 1.0] 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: strA unique name of the Transformation.description: Optional[str]A human-readable description.tags: Optional[Dict[str, str]]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: boolIf True, this Tecton object will be blocked from being deleted or re-created (i.e. a destructive update) during tecton plan/apply.mode: strThe 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: Optional[Dict[str, str]] = NoneAdditional options to configure the Transformation. Used for advanced use cases and beta features.
run(...)​
Run the transformation against inputs.Â
Currently, this method only supports spark_sql, pyspark, and pandas modes.
Parameters
inputs: Union[pandas.DataFrame, pandas.Series, TectonDataFrame, pyspark.sql.DataFrame,Dict, str, int, float, bool]positional arguments to the transformation function. For PySpark and SQL transformations, these are eitherpandas.DataFrameorpyspark.sql.DataFrameobjects. For realtime transformations, these arepandas.Dataframeobjects.context: MaterializationContext = NoneAn optional materialization context object.
Returns
Union[TectonDataFrame,Dict]summary()​
Displays a human-readable summary.validate()​
Deprecation Warning
Deprecated in SDK 1.0. As of Tecton version 1.0 objects are validated upon object creation, so
validate() is unnecessary.