setup_environment
sqllocks_spindle.fabric.setup_environment
¶
Fabric environment setup — standalone script for notebook-based provisioning.
This module can be:
1. Imported and called from Python code
2. Copy-pasted into a Fabric notebook cell for self-service setup
3. Called from the spindle setup-fabric CLI command
It creates a Fabric Environment item with Spindle + dependencies pre-installed.
Functions:¶
get_environment_library_spec()
¶
Return the Fabric Environment library specification for Spindle.
This dict can be used with the Fabric REST API to create or update a Fabric Environment item's library configuration.
get_spark_pool_config()
¶
Return recommended Spark pool configuration for Spindle workloads.
Spindle is CPU-bound (numpy vectorized ops) and memory-light. A small pool with medium nodes is optimal.
print_setup_snippet()
¶
Print the copy-paste setup snippet for Fabric notebooks.
create_spindle_environment(workspace_id, environment_name='Spindle-v2')
¶
Create a Fabric Environment with Spindle pre-installed.
Uses the Fabric REST API to create an Environment item and configure it with sqllocks-spindle and dependencies. Requires an authenticated session (az login or mssparkutils token).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace_id
|
str
|
Fabric workspace GUID. |
required |
environment_name
|
str
|
Name for the Environment item. |
'Spindle-v2'
|
Returns:
| Type | Description |
|---|---|
dict
|
Dict with environment_id and status. |