register() | teradataml DataFrame | Teradata Package for Python - register() - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
December 2024
ft:locale
en-US
ft:lastEdition
2025-01-23
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

register() function registers a Python function or teradataml udf and stores it in Analytics Database for future use. This makes the function reusable across sessions, unlike udf - Function decorator, which is limited to a single session.

Registered UDFs are stored in Analytics Database as a runnable Python script, which is executed using the Script table operator or Apply table operator. See teradataml UDF Prerequisites.

When working with Open Analytics Framework, registered UDFs are stored in either the default user environment or the environment specified by the user in the configuration option.

Registered UDFs are stored in the file system or user environment with the naming convention as tdml_udf_name_<registered udf name>_udf_type_<return type>_register.py.

Be careful when deleting these files directly.

Arguments

Argument Required/Optional Type Description
name Required string Specifies the name of the user defined function to register.
user_function Required function, teradataml udf Specifies the user defined function to create a column for teradataml DataFrame.
returns Optional teradatasqlalchemy types object Specifies the output column type.

When not specified, default is VARCHAR(1024).

If 'user_function' is a teradataml udf, then return type of the udf is used as return type of the registered UDF.​