Partager via


functions Package

This is the module that contains all of the relevant files you will need to import. For example, 'import fabric.functions' or 'import fabric.functions as fn'.

Modules

fabric_class

This module contains the classes that are used to connect to resources like Warehouses, SQL databases, and Lakehouses. You can use these classes by importing them from the fabric.functions module (e.g. from fabric.functions import FabricSqlConnection).

udf_exception

This module contains the exception classes that are used to represent errors that occur during the invocation of a User Data Function. These can be imported from the fabric.functions module.

user_data_functions

This module defines the UserDataFunctions class, which is used to define User Data Functions in Fabric. You can use this class by importing it from the fabric.functions module (e.g. from fabric.functions import UserDataFunctions, or import fabric.functions as fn -> fn.UserDataFunctions()).

Classes

FabricLakehouseClient

This class is used to connect to Lakehouse resources. You can use this class to connect to both SQL and Files endpoints.

A User Data Function with a parameter of this type must be decorated with connection (see the example under Remarks).

Don't worry about using the constructor to create an instance of this class. Fabric will automatically create it for you (as long as you follow the steps within Remarks).

FabricSqlConnection

This class is used to connect to resources that supply SQL connection strings.

A User Data Function with a parameter of this type must be decorated with connection (see the example under Remarks).

Don't worry about using the constructor to create an instance of this class. Fabric will automatically create it for you (as long as you follow the steps within Remarks).

UserDataFunctionContext

This class is used to be able to access certain metadata about a function invocation.

A User Data Function with a parameter of this type must be decorated with context (see the example under Remarks).

Don't worry about using the constructor to create an instance of this class. Fabric will automatically create it for you (as long as you follow the steps within Remarks).

UserDataFunctionError

The exception/error base class for any errors raised during the invocation of a User Data Function.

UserDataFunctionInternalError

Represents an internal error that occurs during the execution of a user-defined function. This error is typically thrown when an unexpected error occurs during the execution of a function that is not related to an input or the user's code.

UserDataFunctionInvalidInputError

Represents an error that occurs when the input provided to a function is invalid. This error is typically thrown when the input provided to a function does not match the expected input type or format.

UserDataFunctionMissingInputError

Represents an error that occurs when a required parameter is missing from the input data provided to a function. This error is typically thrown when a parameter is expected to be present in the input data but is not found.

UserDataFunctionResponseTooLargeError

Represents an error that occurs when the response generated by a function is too large. This limit is currently set to 30 megabytes.

UserDataFunctionTimeoutError

Represents an error that occurs when a function exceeds the timeout limit set for the function. This limit is currently set to 200 seconds.

UserDataFunctions

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.

UserThrownError

Represents an error that is thrown by the user's code during the execution of a function. This error is typically thrown when the user's code encounters an error that is not related to the input data and can be the base class for custom errors.