Databricks academy error setup - Free Edition with Serverless Compute
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2025 09:47 AM
Databricks is passing from the Community Edition to the Free Edition, which I am currently using.
When executing the Includes/Classroom-setup notebooks the following exception is raised: [CONFIG_NOT_AVAILABLE] Configuration dbacademy.deprecation.logging is not available. SQLSTATE: 42K0I
Inspecting the code, the problem seems to be related to the spark.conf.get() method, which is declared as follows in the documentation of the academy repo
---------------------------------------------------------
get(self, key: str, default: Union[str, NoneType, pyspark._globals._NoValueType] = <no value>) -> Optional[str] Parameters
key : str | key of the configuration to get.
default : str, optional | value of the configuration to get if the key does not exist.
Returns The string value of the configuration set, or None.
Examples : spark.conf.get("non-existent-key", "my_default") // 'my_default'
--------------------------------------------------------
However, testing the method clearly shows that it is raising an exception instead of returning the default value for the missing key.
This seems to be solvable using spark.conf.getAll.get(key, default), where spark.conf.getAll is retuning a python dict containing all the configurations. However, this problem is present also in the inner code of the "v3.0.23" dbacademy library version I am using, which raises the [CONFIG_NOT_AVAILABLE] error when importing modules of the library (in my case the dbgems module).
- Labels:
-
Spark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2025 12:44 PM
@iFoxz17 The CONFIG_NOT_AVAILABLE error (SQLSTATE: 42K0I) occurs because spark.conf.get(key) in Databricks Free Edition throws an exception for missing configuration keys like dbacademy.deprecation.logging, instead of returning the default value as expected from PySpark documentation
Solution thinking:
- Use spark.conf.getAll(): Replace spark.conf.get(key, default) with dict(spark.conf.getAll()).get(key, default) to safely retrieve configs without exceptions, as your testing confirmed
- Example: version = dict(spark.conf.getAll()).get("dbacademy.deprecation.logging", "default_value")
- Pre-set configurations: Add spark.conf.set("dbacademy.deprecation.logging", "false") (or appropriate value) at the notebook start before imports https://community.databricks.com/t5/data-engineering/databricks-academy-setup-error-data-engineering...
- Switch to DBR 13.3 LTS if available in Free Edition for better compatibility
- Check for newer dbacademy versions via %pip install --upgrade dbacademy Check for newer dbacademy versions via %pip install --upgrade dbacademy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2025 01:45 AM
Free edition doesn't have DBR versioning as it is serverless, doesn't allow spark.conf.set etc...
My blog: https://databrickster.medium.com/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2025 12:58 AM - edited 12-04-2025 12:59 AM
@ManojkMohan as mentioned in the first post I already used dict(spark.conf.getAll()).get(key, default) where possible.
However the problem stands when importing modules, like:
- from dbacademy import dbgems
--------------------------------------------------------------