次の方法で共有


spark Package

Functions

get_fabric_runtime

Get the default Fabric runtime version for the specified workspace.

get_fabric_runtime(workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> str

Parameters

Name Description
workspace
str or UUID

The Fabric workspace name or UUID object containing the workspace ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

Default value: None
credential
<xref:sempy.fabric.spark.TokenCredential>

The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used.

Default value: None

Returns

Type Description
str

The Fabric runtime version for the specified workspace. See Apache Spark Runtimes in Fabric.

get_spark_settings

Get the Spark settings for the specified workspace.

This is a wrapper function for Workspace Settings - Get Spark Settings.

get_spark_settings(workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> Dict[str, Any]

Parameters

Name Description
workspace
str or UUID

The Fabric workspace name or UUID object containing the workspace ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

Default value: None
credential
<xref:sempy.fabric.spark.TokenCredential>

The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used.

Default value: None

Returns

Type Description

The Spark settings for the specified workspace.

set_fabric_runtime

Set the default Fabric runtime version for the specified workspace.

set_fabric_runtime(runtime_version: Literal['1.1', '1.2', '1.3'], workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> None

Parameters

Name Description
runtime_version
Required
<xref:Literal>[<xref:”1.1”, "1.2", "1.3"]

The Fabric runtime version to set. See Apache Spark Runtimes in Fabric.

workspace
str or UUID

The Fabric workspace name or UUID object containing the workspace ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

Default value: None
credential
<xref:sempy.fabric.spark.TokenCredential>

The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used.

Default value: None

update_spark_settings

Update the Spark settings for the specified workspace.

This is a wrapper function for Workspace Settings - Update Spark Settings.

update_spark_settings(spark_settings: Dict[str, Any], workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> None

Parameters

Name Description
spark_settings
Required
<xref:Dict>[str, <xref:Any>]

The Spark settings to update.

workspace
str or UUID

The Fabric workspace name or UUID object containing the workspace ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

Default value: None
credential
<xref:sempy.fabric.spark.TokenCredential>

The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used.

Default value: None