This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
If you haven’t already, check out Arun Ulag’s hero blog “FabCon and SQLCon 2026: Unifying databases and Fabric on a single, complete platform” for a complete look at all of our FabCon and SQLCon announcements across both Fabric and our database offerings.
The Fabric user data functions (UDF) programmability model now includes the ability to define functions with default argument values. This feature allows you streamline your workflow by minimizing the need to specify every argument each time you call a function—any parameters you leave out will automatically use their default values. As a result, you can write cleaner, more concise code and focus on the logic that matters most.
def function_name(param1: type = value1, param2: type = value2, listparam: list | None = None, ...) -> output_type:
# function body
| JSON type | Python data type |
| String | str |
| Date/time string | datetime (for example, ISO 8601 input parsed to datetime) |
| Boolean | bool |
| Number | int, float |
| Array | list (eg. list[int]) |
| Object | dict |
| Object or array of objects | pandas DataFrame, pandas Series |
import fabric.functions as fn
udf = fn.UserDataFunctions()
@udf.function()
def add_tags(record: dict, default_tags: list | None = None) -> dict:
"""
Adds default tags to a record if no tags exist.
Args:
record (dict): Input row, e.g. {"id": 1, "tags": ["priority"]}.
default_tags (list): Tags applied when record has no tags.
Returns:
dict: Record with a final_tags list added.
"""
if default_tags is None:
default_tags = ["new", "unreviewed"]
tags = record.get("tags") or default_tags
return {**record, "final_tags": tags}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.