Module: spark_fuse.spark¶
create_session ¶
create_session(app_name: str = 'spark-fuse', *, master: Optional[str] = None, extra_configs: Optional[Dict[str, str]] = None) -> SparkSession
Create a SparkSession with Delta configs and light Azure defaults.
- Uses
local[2]
when no master is provided and not on Databricks or Fabric. - Applies Delta extensions; works both on Databricks and local delta-spark.
- Accepts
extra_configs
to inject environment-specific credentials.
Source code in src/spark_fuse/spark.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
detect_environment ¶
detect_environment() -> str
Detect a likely runtime environment: databricks, fabric, or local.
Heuristics only; callers should not rely on this for security decisions.
Source code in src/spark_fuse/spark.py
21 22 23 24 25 26 27 28 29 30 |
|