Skip to main content
Version: Beta 🚧

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​

NameData TypeDescription
created_atOptional[datetime.datetime]Returns the time that this Tecton object was created or last updated. None for locally defined objects.
defined_inOptional[str]The repo filename where this object was declared. None for locally defined objects.
descriptionOptional[str]Returns the description of the Tecton object.
idstrReturns the unique id of the Tecton object.
info
modeTransformation mode - Spark, Python, Pyspark, etc.
namestrReturns the name of the Tecton object.
ownerOptional[str]Returns the owner of the Tecton object.
prevent_destroyIf set to True, Tecton will block destructive actions taken on this Transformation.
tagsDict[str, str]Returns the tags of the Tecton object.
transformation_mode
transformerThe user function for this transformation.
workspaceOptional[str]Returns the workspace that this Tecton object belongs to. None for locally defined objects.

Methods​

NameDescription
__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 either pandas.DataFrame or pyspark.sql.DataFrame objects. For realtime transformations, these are pandas.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

Was this page helpful?