Semantic link functions for holidays

0.14.0 · active · verified Wed Apr 15

The `semantic-link-functions-holidays` library provides semantic functions, such as `is_holiday`, that enable the enrichment of a FabricDataFrame with public holiday information. It is part of the broader Microsoft Fabric semantic link feature, designed to bridge Power BI datasets and Synapse Data Science notebooks. The current version is 0.14.0, released on March 17, 2026, with updates typically tied to the `semantic-link` project's release cadence.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a `FabricDataFrame` and use the dynamically exposed `is_holiday` semantic function to determine if a given date is a public holiday in a specified country. The function relies on column metadata to identify relevant date and country columns.

from sempy.fabric import FabricDataFrame
import pandas as pd

# Create a FabricDataFrame with relevant columns and metadata
# In a real Microsoft Fabric environment, FabricDataFrame often comes from reading a Power BI semantic model.
df = FabricDataFrame(
    pd.DataFrame({
        "country": ["US", "AT", "DE", "US"],
        "date": ["2023-01-01", "2023-01-06", "2023-10-03", "2023-07-04"]
    }),
    column_metadata={
        "country": {"data_category": "Country"},
        "date": {"data_category": "Date"}
    }
)

# The is_holiday function is dynamically exposed if appropriate columns and metadata exist.
# It will return True if the date is a holiday in the given country.
df["is_public_holiday"] = df.is_holiday(col_country="country", col_date="date")

print(df)

view raw JSON →