Share via


UserDataFunctions Class

This class is necessary to define User Data Functions in Fabric. Please ensure an instantiation of this class exists in your code before any User Data Functions are defined.

Constructor

UserDataFunctions()

Remarks

This class is used to define User Data Functions in Fabric. The class must be instantiated before any User Data Functions are defined. The instantiation of this class is required.

Methods

connection

This decorator is used to tell a User Data Function that there is a connection to a data source. This decorator must be used in tandem with a parameter of type FabricSqlConnection or FabricLakehouseClient (see the example under Remarks).

context

This decorator is used to tell a User Data Function that there is a UserDataFunctionContext parameter. This decorator must be used in tandem with a parameter of type UserDataFunctionContext.

fabric_item_input

This decorator is deprecated. Please use connection instead. Note the alias parameter in connection is now the first parameter.

function

This decorator is used to define a User Data Function in Fabric. The function must be decorated with this decorator in order to be recognized as a User Data Function.

get_udf_oai_spec
user_data_function_context_input

This decorator is deprecated. Please use context instead.

connection

This decorator is used to tell a User Data Function that there is a connection to a data source. This decorator must be used in tandem with a parameter of type FabricSqlConnection or FabricLakehouseClient (see the example under Remarks).

connection(alias: str, argName: str | None = None, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
alias
Required
str

The alias of the data connection that is being used.

argName
str

The name of the parameter in the function signature. If not provided, the alias will be used.

Default value: None

context

This decorator is used to tell a User Data Function that there is a UserDataFunctionContext parameter. This decorator must be used in tandem with a parameter of type UserDataFunctionContext.

context(argName, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
argName
Required
str

The name of the parameter in the function signature.

fabric_item_input

This decorator is deprecated. Please use connection instead. Note the alias parameter in connection is now the first parameter.

fabric_item_input(argName, alias: str, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
argName
Required
alias
Required

function

This decorator is used to define a User Data Function in Fabric. The function must be decorated with this decorator in order to be recognized as a User Data Function.

function(name=None)

Parameters

Name Description
name
str

The name of the function. This parameter is not used in the current version of Fabric.

Default value: None

get_udf_oai_spec

get_udf_oai_spec(publicUrl: str, privateFunctions: list, specFormat: str = 'yaml') -> str

Parameters

Name Description
publicUrl
Required
privateFunctions
Required
specFormat
Default value: yaml

user_data_function_context_input

This decorator is deprecated. Please use context instead.

user_data_function_context_input(argName, **kwargs) -> Callable[[...], Any]

Parameters

Name Description
argName
Required