{"id":6451,"library":"semantic-link-functions-meteostat","title":"Semantic link functions for meteostat package","description":"This library provides semantic link functions specifically designed for integrating Meteostat historical weather data with FabricDataFrames within Microsoft Fabric. It enables the enrichment of tabular data with weather-related insights, exposing these functions dynamically on FabricDataFrames. The library is currently at version 0.14.0 and is part of the broader Semantic Link ecosystem, which typically sees frequent updates aligning with Microsoft Fabric'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","meteostat","weather-data","data-enrichment","dataframe","power-bi"],"install":[{"cmd":"%pip install semantic-link-functions-meteostat","lang":"bash","label":"Install directly"},{"cmd":"%pip install semantic-link","lang":"bash","label":"Install via meta-package (recommended for full Semantic Link)"}],"dependencies":[{"reason":"This library provides semantic link functions specifically for the 'meteostat' package, making it a core dependency for data fetching.","package":"meteostat","optional":false},{"reason":"Provides the core FabricDataFrame and semantic link functionalities. Usually installed as part of the 'semantic-link' meta-package.","package":"semantic-link-sempy","optional":false}],"imports":[{"note":"Semantic functions are exposed as methods on FabricDataFrame instances, often after reading data from a semantic model.","symbol":"FabricDataFrame","correct":"from sempy.fabric import FabricDataFrame"}],"quickstart":{"code":"import pandas as pd\nfrom sempy.fabric import FabricDataFrame\nimport datetime\n\n# Assume 'fabric' is available in the Microsoft Fabric environment\n# and can read from a semantic model or lakehouse.\n# For a runnable example outside Fabric, we'll create a dummy FabricDataFrame.\n\n# Create a sample FabricDataFrame with relevant columns\ndf = FabricDataFrame({\n    'city': ['London', 'Paris', 'Berlin'],\n    'latitude': [51.5074, 48.8566, 52.5200],\n    'longitude': [-0.1278, 2.3522, 13.4050],\n    'date': [datetime.date(2023, 1, 1), datetime.date(2023, 1, 1), datetime.date(2023, 1, 1)]\n})\n\nprint(\"Original FabricDataFrame:\")\nprint(df)\n\n# In a Fabric notebook, a semantic function (e.g., 'add_weather_data')\n# would be dynamically discoverable via autocomplete on the FabricDataFrame.\n# The exact function name depends on the implementation within semantic-link-functions-meteostat.\n# This is a conceptual example of how such a function would be called.\n# For demonstration, we'll simulate an enrichment.\n\n# Example of conceptually calling a semantic function to enrich with weather data\n# (Actual function name and parameters would be discovered in Fabric Notebooks)\n# try:\n#     enriched_df = df.add_meteostat_weather_data(date_column='date', lat_column='latitude', lon_column='longitude')\n#     print(\"\\nFabricDataFrame enriched with weather data:\")\n#     print(enriched_df)\n# except AttributeError:\n#     print(\"\\nNote: The exact semantic function like 'add_meteostat_weather_data' \")\n#     print(\"      is dynamically exposed in Microsoft Fabric notebooks. \\n      This local example demonstrates the intended usage pattern.\")\n\n# A more concrete placeholder showing expected interaction in Fabric\n# In a Fabric notebook, you would typically read a table first:\n# df_from_fabric = fabric.read_table('MyDataset', 'SalesData')\n# Then apply a semantic function:\n# enriched_df = df_from_fabric.add_meteostat_weather_data()\n\nprint(\"\\nFurther processing would involve calling specific semantic functions exposed on the FabricDataFrame.\")\nprint(\"These functions would dynamically appear in autocomplete within Microsoft Fabric notebooks.\")","lang":"python","description":"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."},"warnings":[{"fix":"Ensure you are developing and running your code within a Microsoft Fabric notebook environment.","message":"This 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.","severity":"gotcha","affected_versions":"All"},{"fix":"Remove the `pandas_convert_dtypes=True` argument from calls to `fabric.evaluate_measure` or similar functions, as type conversion is now handled reliably by default.","message":"The `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`.","severity":"breaking","affected_versions":">=0.3.6 (of semantic-link-sempy)"},{"fix":"Always 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.","message":"While 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.","severity":"gotcha","affected_versions":"All"},{"fix":"After 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.","message":"Semantic 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.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z"}