-
Notifications
You must be signed in to change notification settings - Fork 454
Description
Describe the bug
The %%configure magic command in SparkMagic completely replaces the session_configs object with the JSON provided in the cell. It does not merge the new configuration with existing settings from ~/.sparkmagic/config.json, which can result in unintentional omission of important parameters like proxyUser or default Spark configs.
To Reproduce
- Define a
~/.sparkmagic/config.jsonfile with the following:
"session_configs": {
"proxyUser": "jeffrey.zzz",
"conf": {
"spark.sql.catalog.spark_catalog.type": "hive"
}
}- Run the following in a notebook:
%%configure -f
{
"conf": {
"spark.executor.memory": "8g"
}
}Expected behavior
Expected that the new settings provided via %%configure would be merged with the existing session_configs, or at least that the documentation would explicitly warn that a full replacement occurs.
Screenshots
N/A
Versions:
- SparkMagic:
0.21.0 - Livy: (if known)
- Spark: (if known)
Additional context
This behavior stems from the override() function in configuration.py#L34, where:
overrides[config] = valueThis line replaces the full session_configs object rather than merging it with prior contents.
It would be helpful to clarify this behavior in the documentation or consider enhancing the configuration logic to support merging, or at least offer a warning when this overwrite occurs.
Thanks for maintaining SparkMagic!