Registry / azure / semantic-link-functions-validators

semantic-link-functions-validators

JSON →
library0.14.1pypypi✓ verified 85d ago

Semantic Link Functions - Validators is a Python library that extends Microsoft FabricDataFrames with semantic validation capabilities. It provides built-in functions for validating common data types such as email addresses and credit card numbers, leveraging the underlying 'validators' Python package. This library is part of the broader Microsoft Fabric semantic link ecosystem, enabling enhanced data quality within data science workflows in Fabric notebooks. It is actively maintained, with the current version being 0.14.0.

pip install semantic-link-functions-validators
INSTALL
IMPORT
SIG · SEMANTIC-LINK-FUNC
S
semantic-link-functions-validators
azurepythonv0.14.1
Install
56.4s avg
Import
6232ms
Disk
1203MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.14.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 58.13s
py 3.11
✕ build_error
✓ 57.08s
py 3.12
✕ build_error
✓ 54.58s
py 3.13
✕ build_error
✓ 55.88s
py 3.9
✕ build_error
✕ build_error
1203MB installed
● package 1203MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FabricDataFrame
from sempy.fabric import FabricDataFrame
Validation functions are exposed dynamically on FabricDataFrames. Ensure 'sempy' is installed and available.

This quickstart demonstrates how to use `semantic-link-functions-validators` to validate email addresses and credit card numbers within a `FabricDataFrame`. The validation functions (`is_email`, `is_credit_card`) are called directly as methods on the DataFrame series. This example is designed for use within a Microsoft Fabric notebook environment where `FabricDataFrame` is available and semantic link is active.

import pandas as pd from sempy.fabric import FabricDataFrame # NOTE: This code is intended to be run within a Microsoft Fabric notebook # where semantic link is initialized. Running outside might require additional setup. # For demonstration, we simulate a FabricDataFrame. try: df = FabricDataFrame({ 'email_column': ['test@example.com', 'invalid-email', 'another@domain.co'], 'cc_number': ['1234-5678-9012-3456', '1111-2222-3333', '4567-8901-2345-6789'] }) # Apply semantic validation functions directly to the DataFrame columns df['is_valid_email'] = df['email_column'].is_email() df['is_valid_cc'] = df['cc_number'].is_credit_card() print(df) except ImportError: print("Please ensure 'semantic-link-functions-validators' and 'sempy' are installed.") print("Also, consider running this in a Microsoft Fabric environment for full functionality.") except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
breakingThe broader 'semantic-link' meta-package (and 'semantic-link-sempy') has reported breaking compatibility with 'pandas >= 3.0', leading to 'AttributeError: 'types.SimpleNamespace' object has no attribute 'suffixes''. As 'semantic-link-functions-validators' integrates with 'FabricDataFrame' (a pandas subclass), this incompatibility may affect its usage if 'pandas 3.0+' is in the environment with older 'semantic-link' or 'sempy' versions.
fix
Downgrade pandas to a version below 3.0, or ensure you are using a compatible version of 'semantic-link' (e.g., semantic-link >= 0.13.1 or semantic-link-sempy >= 0.9.4) which includes a fix. Alternatively, install 'semantic-link-sempy' instead of the full 'semantic-link' meta-package if you only need core SemPy functionalities and individual function packages.
affects: semantic-link < 0.13.1, semantic-link-sempy < 0.9.4 when used with pandas >= 3.0
gotchaThis library is primarily designed for use within Microsoft Fabric notebooks and leverages the `FabricDataFrame` structure and semantic link's environment. While the `FabricDataFrame` can be instantiated locally (as shown in the quickstart for demonstration), some functionalities, especially those involving metadata propagation or interaction with Power BI semantic models, might require a genuine Fabric environment for full operation and discovery of semantic functions.
fix
For full functionality and integration, run this library within a Microsoft Fabric notebook. Ensure the appropriate Fabric runtime (Spark 3.4+) is used, where 'semantic-link' may be preinstalled or easily updated.
affects: All versions
gotchaAuthentication issues (403 errors) have been reported when using `sempy.fabric` functions, which `semantic-link-functions-validators` relies upon. This can stem from environment context or token acquisition problems within Fabric notebooks.
fix
Check Microsoft Fabric documentation for current authentication best practices. Consider downgrading the `semantic-link-sempy` package to a stable version (e.g., 0.9.3 was mentioned as a workaround in some cases) or ensuring the workspace environment is correctly configured to provide valid tokens.
affects: Specific versions of `semantic-link-sempy`, notably around 0.9.3 and later if not correctly configured.
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'semantic_link_functions_validators'
The 'semantic-link-functions-validators' library is not installed in the current Python environment, or there is a typo in the import statement.
fix
Install the package using pip: `pip install semantic-link-functions-validators`
AttributeError: 'DataFrame' object has no attribute 'sl'
The 'sl' accessor, where validation functions are registered, is provided by the 'semantic-link' library and needs to be enabled for pandas DataFrames or used with a FabricDataFrame.
fix
Ensure 'semantic-link' is installed and enable the default extension for pandas DataFrames: `import semantic_link; semantic_link.enable_default_extension()`. Alternatively, use `from semantic_link.fabric import FabricDataFrame`.
AttributeError: 'FabricDataFrame' object has no attribute 'is_email'
Validation functions like 'is_email' are added to the 'sl' accessor, not directly to the FabricDataFrame object.
fix
Access the validation function through the 'sl' accessor: `df.sl.is_email('email_column')`
Upgrade
Version history
0.14.1latest on PyPI · released Apr 29, 2026
Audit
Dependencies
validatorsrequiredProvides the core validation logic for data types like email and credit card numbers.
semantic-linkoptionalMeta-package for the Semantic Link ecosystem, often installed alongside. While 'semantic-link-functions-validators' can be installed independently, its full functionality is realized within the Semantic Link/SemPy environment which provides FabricDataFrames.
sempyrequiredThe core Python library for Semantic Link (SemPy) which provides the FabricDataFrame structure and mechanisms for semantic functions.
Agent activity
33 hits · last 30 days
node
30
OpenAI (training)
1
Resources
semantic-link-functions-validators — pip install semantic-link-functions-validators · libregistry