Registry /
data / semantic-link-functions-meteostat
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
FabricDataFrame
✓ from sempy.fabric import FabricDataFrame
Semantic functions are exposed as methods on FabricDataFrame instances, often after reading data from a semantic model.
This quickstart demonstrates the general pattern of using semantic link functions. It involves creating a FabricDataFrame (or reading one from a semantic model in a Microsoft Fabric notebook) and then applying a semantic function to enrich it. While the exact function names for Meteostat are dynamically discovered in Fabric, this example illustrates the conceptual flow. The library integrates with the `sempy.fabric.FabricDataFrame` to provide weather data enrichment capabilities.
import pandas as pd
from sempy.fabric import FabricDataFrame
import datetime
# Assume 'fabric' is available in the Microsoft Fabric environment
# and can read from a semantic model or lakehouse.
# For a runnable example outside Fabric, we'll create a dummy FabricDataFrame.
# Create a sample FabricDataFrame with relevant columns
df = FabricDataFrame({
'city': ['London', 'Paris', 'Berlin'],
'latitude': [51.5074, 48.8566, 52.5200],
'longitude': [-0.1278, 2.3522, 13.4050],
'date': [datetime.date(2023, 1, 1), datetime.date(2023, 1, 1), datetime.date(2023, 1, 1)]
})
print("Original FabricDataFrame:")
print(df)
# In a Fabric notebook, a semantic function (e.g., 'add_weather_data')
# would be dynamically discoverable via autocomplete on the FabricDataFrame.
# The exact function name depends on the implementation within semantic-link-functions-meteostat.
# This is a conceptual example of how such a function would be called.
# For demonstration, we'll simulate an enrichment.
# Example of conceptually calling a semantic function to enrich with weather data
# (Actual function name and parameters would be discovered in Fabric Notebooks)
# try:
# enriched_df = df.add_meteostat_weather_data(date_column='date', lat_column='latitude', lon_column='longitude')
# print("\nFabricDataFrame enriched with weather data:")
# print(enriched_df)
# except AttributeError:
# print("\nNote: The exact semantic function like 'add_meteostat_weather_data' ")
# print(" is dynamically exposed in Microsoft Fabric notebooks. \n This local example demonstrates the intended usage pattern.")
# A more concrete placeholder showing expected interaction in Fabric
# In a Fabric notebook, you would typically read a table first:
# df_from_fabric = fabric.read_table('MyDataset', 'SalesData')
# Then apply a semantic function:
# enriched_df = df_from_fabric.add_meteostat_weather_data()
print("\nFurther processing would involve calling specific semantic functions exposed on the FabricDataFrame.")
print("These functions would dynamically appear in autocomplete within Microsoft Fabric notebooks.")
Debug
Known issues
gotchaThis library, as part of the Semantic Link ecosystem, is primarily designed and supported for use within Microsoft Fabric notebooks. Its functionality relies on the Fabric runtime and its specific environment.fixEnsure you are developing and running your code within a Microsoft Fabric notebook environment.
affects: All
breakingThe `pandas_convert_dtypes` parameter in `fabric.evaluate_measure` (from the core `semantic-link-sempy` package, which this library depends on) was removed in version 0.3.6. Using it in newer versions will result in a `TypeError`.fixRemove the `pandas_convert_dtypes=True` argument from calls to `fabric.evaluate_measure` or similar functions, as type conversion is now handled reliably by default.
affects: >=0.3.6 (of semantic-link-sempy)
gotchaWhile the core `semantic-link` (SemPy) package might be preinstalled in Fabric Spark 3.4 and above, the `semantic-link-functions` package (which includes this Meteostat-specific library) may still need manual installation or an update to access the latest features and functions.fixAlways include `%pip install -U semantic-link` (or `%pip install -U semantic-link-functions-meteostat` for just this package) in your Fabric notebook to ensure you have the latest versions and all required components.
affects: All
gotchaSemantic Link functions are dynamically discovered and exposed as methods on a `FabricDataFrame` or `FabricSeries`. This means there isn't a direct `import` statement for specific functions from this library; rather, they appear via autocomplete on your DataFrame object.fixAfter importing `FabricDataFrame` and creating/reading your data into it, use IDE autocomplete (e.g., Ctrl+Space in a notebook) on the DataFrame object (e.g., `df.`) to discover available semantic functions.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'semantic_link_functions_meteostat'
The `semantic-link-functions-meteostat` package is either not installed in the environment or the import statement uses an incorrect module name.
fixInstall the package using `pip install semantic-link-functions-meteostat` and ensure the import statement uses `import semantic_link_functions_meteostat` or `from semantic_link_functions_meteostat import <function_name>`.
AttributeError: 'DataFrame' object has no attribute 'sl_enrich_meteostat_weather'
The `sl_enrich_meteostat_weather` function is designed to be called exclusively on a `FabricDataFrame` object, but it was invoked on a standard pandas DataFrame or a Spark DataFrame not converted to a FabricDataFrame.
fixEnsure your DataFrame is a `FabricDataFrame` by converting a Spark DataFrame (e.g., `fabric_df = FabricDataFrame(spark_df)`) before attempting to call the semantic link enrichment function.
ValueError: One or more required columns for Meteostat enrichment (e.g., 'latitude', 'longitude', 'start_date') are missing from the DataFrame.
The `sl_enrich_meteostat_weather` function requires specific geographical and temporal columns to be present in the input `FabricDataFrame` to fetch Meteostat data, and one or more were not found.
fixVerify that your `FabricDataFrame` contains columns for latitude, longitude, and date ranges (e.g., 'start_date', 'end_date'), or explicitly map your existing column names using the appropriate arguments in the `sl_enrich_meteostat_weather` function call.
ImportError: cannot import name 'FabricDataFrame' from 'semantic_link.fabric'
The core `semantic-link` library, which provides the `FabricDataFrame` class, is either not installed, installed incorrectly, or an incompatible version is present in your environment.
fixEnsure the `semantic-link` package is installed (`pip install semantic-link`) and that its version is compatible with both your Microsoft Fabric environment and `semantic-link-functions-meteostat`. Restart your session or environment if needed.
Upgrade
Version history
0.14.1latest on PyPI · released Apr 29, 2026
Audit
Dependencies
meteostatrequiredThis library provides semantic link functions specifically for the 'meteostat' package, making it a core dependency for data fetching.
semantic-link-sempyrequiredProvides the core FabricDataFrame and semantic link functionalities. Usually installed as part of the 'semantic-link' meta-package.