共用方式為


functions Package

Packages

matcher

Functions

semantic_function

Decorator for registering a function as a SemanticFunction.

semantic_function(name: str | None = None, requirement: Callable[[FabricDataFrame | FabricSeries], bool] | None = None, suggestion: Callable[[str, FabricDataFrame | FabricSeries], List[str]] | None = None, pip_packages: List[str] | None = None, series_type: Type | None = None) -> Callable

Parameters

Name Description
name
str

Override function name.

Default value: None
requirement

Function that returns True if this SemanticFunction is applicable to a dataframe that is passed as an argument to the function.

Default value: None
suggestion
list of str

List of suggestions.

Default value: None
pip_packages
list of str

List of pip packages to include in installation message.

Default value: None
series_type

Expected type if the semantic function should be applied on a FabricSeries.

Default value: None

Returns

Type Description

Decorated function.

semantic_parameters

Attach the column type matcher to a function.

semantic_parameters(*args, **kwargs) -> Callable

Parameters

Name Description
*args
Required

A list of column type matchers for which the resolve column name is ignored.

**kwargs
Required

A dictionary of column type matchers where key is the column name and value is the matcher.

Returns

Type Description

The decorated function injection the column type matchers.

semantic_property

Decorator for registering a property as a SemanticFunction.

semantic_property(name: str | None = None, requirement: Callable[[FabricDataFrame | FabricSeries], bool] | None = None, suggestion: Callable[[str, FabricDataFrame | FabricSeries], List[str]] | None = None, pip_packages: List[str] | None = None, series_type: Type | None = None) -> Callable

Parameters

Name Description
name
str

Override function name.

Default value: None
requirement

Function that returns True if this SemanticFunction is applicable to a dataframe that is passed as an argument to the function.

Default value: None
suggestion
list of str

List of suggestions.

Default value: None
pip_packages
list of str

List of pip packages to include in installation message.

Default value: None
series_type

Expected type if the semantic function should be applied on a FabricSeries.

Default value: None

Returns

Type Description

Decorated function.