{"id":6450,"library":"semantic-link-functions-holidays","title":"Semantic link functions for holidays","description":"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.","status":"active","version":"0.14.0","language":"en","source_language":"en","source_url":"https://github.com/microsoft/semantic-link-functions","tags":["microsoft-fabric","semantic-link","holidays","dataframe","data-enrichment","powerbi"],"install":[{"cmd":"pip install semantic-link-functions-holidays","lang":"bash","label":"Install only holidays functions"},{"cmd":"pip install semantic-link","lang":"bash","label":"Install all semantic link packages (recommended)"}],"dependencies":[{"reason":"Core functionality for holiday detection is provided by this package.","package":"holidays","optional":false},{"reason":"Provides the core FabricDataFrame data structure and functionality.","package":"sempy","optional":false},{"reason":"FabricDataFrame is built upon the pandas DataFrame.","package":"pandas","optional":false}],"imports":[{"note":"Semantic functions like `is_holiday` are dynamically exposed as methods on a FabricDataFrame, rather than imported directly. FabricDataFrame itself is imported from `sempy.fabric`.","symbol":"FabricDataFrame","correct":"from sempy.fabric import FabricDataFrame"}],"quickstart":{"code":"from sempy.fabric import FabricDataFrame\nimport pandas as pd\n\n# Create a FabricDataFrame with relevant columns and metadata\n# In a real Microsoft Fabric environment, FabricDataFrame often comes from reading a Power BI semantic model.\ndf = FabricDataFrame(\n    pd.DataFrame({\n        \"country\": [\"US\", \"AT\", \"DE\", \"US\"],\n        \"date\": [\"2023-01-01\", \"2023-01-06\", \"2023-10-03\", \"2023-07-04\"]\n    }),\n    column_metadata={\n        \"country\": {\"data_category\": \"Country\"},\n        \"date\": {\"data_category\": \"Date\"}\n    }\n)\n\n# The is_holiday function is dynamically exposed if appropriate columns and metadata exist.\n# It will return True if the date is a holiday in the given country.\ndf[\"is_public_holiday\"] = df.is_holiday(col_country=\"country\", col_date=\"date\")\n\nprint(df)","lang":"python","description":"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."},"warnings":[{"fix":"Ensure you are operating within a Microsoft Fabric notebook for optimal experience, or be aware of the limitations outside of it.","message":"This library is primarily designed for use within Microsoft Fabric Synapse Data Science notebooks. While parts of `sempy` can be installed standalone, the full integration and benefits of semantic functions are realized in the Fabric environment.","severity":"gotcha","affected_versions":"All"},{"fix":"Structure your `FabricDataFrame` with correct column names and metadata categories for functions to become available. Refer to the quickstart for an example.","message":"Semantic functions like `is_holiday` are not directly imported but are dynamically exposed as methods on a `FabricDataFrame`. This occurs when the DataFrame contains columns with appropriate data types and metadata (e.g., 'date' and 'country' columns with 'Date' and 'Country' data categories).","severity":"gotcha","affected_versions":"All"},{"fix":"Consult the documentation for the `holidays` package if encountering unexpected behavior with holiday calculations.","message":"The `semantic-link-functions-holidays` package wraps the `holidays` Python package. Any underlying issues, breaking changes, or specific usage patterns related to the `holidays` package might indirectly affect this semantic function.","severity":"gotcha","affected_versions":"All"},{"fix":"Consider `pip install semantic-link` if you need broader semantic link features beyond just holiday detection.","message":"For a complete Semantic Link experience, it is often recommended to install the meta-package `semantic-link` (`pip install semantic-link`). This ensures all individual semantic link function packages, including holidays, are installed. Only installing `semantic-link-functions-holidays` will limit available functionality.","severity":"gotcha","affected_versions":"All"},{"fix":"Always run `%pip install -U semantic-link` (or the specific function package) in your notebook cell to ensure you have the latest versions of all semantic link components.","message":"In Microsoft Fabric with Spark 3.4 or later, the core `semantic-link` package is preinstalled. However, specific function packages like `semantic-link-functions-holidays` may still need to be explicitly installed or updated to their latest version.","severity":"gotcha","affected_versions":">=0.13.0 (when core became preinstalled)"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z"}