Attributes¶
spark_expectations.core.current_dir = os.path.dirname(os.path.abspath(__file__))
module-attribute
¶
Functions¶
spark_expectations.core.get_spark_session() -> SparkSession
¶
Source code in spark_expectations/core/__init__.py
spark_expectations.core.load_configurations(spark: SparkSession) -> None
¶
Load Spark configuration settings from a YAML file and apply them to the provided SparkSession.
This function:
- Reads the configuration file located at ../config/spark-default-config.yaml
.
- Separates streaming (se.streaming.*
) and notification (spark.expectations.*
) configurations into dictionaries.
- Sets other configuration values directly in the Spark session.
- Stores streaming and notification configs as JSON strings in Spark session configs.
- Raises RuntimeError for file not found, YAML parsing errors, permission issues, or other exceptions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spark
|
SparkSession
|
The SparkSession to apply configurations to. |
required |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the configuration file is not found, cannot be parsed, or other errors occur. |