Deprecation warning for 'zorder' config key in dbt-core 1.11
Describe the bug
When using the zorder config key in dbt-databricks model configurations with dbt-core 1.11, a deprecation warning is raised:
[WARNING][CustomKeyInConfigDeprecation]: Deprecated functionality
Custom key `zorder` found in `config` at path `models[0].config` in file `...yml`.
Custom config keys should move into the `config.meta`.
The warning indicates that zorder is treated as a custom/unknown config key, even though it is a legitimate dbt-databricks configuration option that has been supported since version 1.4.3 (April 19, 2023).
Steps To Reproduce
-
Create a dbt model with a
zorderconfig in the model YAML contract:models: - name: my_model config: zorder: ["column1", "column2"] -
Run
dbt compileordbt runwith dbt-core 1.11 and dbt-databricks 1.11.4 -
The compilation succeeds but raises the deprecation warning
Expected behavior
The zorder config should be recognized as a valid dbt-databricks config key without raising a deprecation warning when using dbt-core 1.11+.
Screenshots and log output
dbt compile --select my_model
07:17:58 Running with dbt=1.11.2
07:18:01 Registered adapter: databricks=1.11.4
07:18:02 Unable to do partial parsing because of a version mismatch
07:18:03 Encountered an error:
Compilation Error
[WARNING][CustomKeyInConfigDeprecation]: Deprecated functionality
Custom key `zorder` found in `config` at path `models[0].config` in file `...yml`.
Custom config keys should move into the `config.meta`.
System information
The output of dbt --version:
Core:
- installed: 1.11.2
- latest: 1.11.2 - Up to date!
Plugins:
- databricks: 1.11.4 - Up to date!
- spark: 1.10.0 - Up to date!
The operating system you're using: Windows
The output of python --version:
Python 3.12.12
Additional context
Root cause analysis:
This issue appears to be caused by dbt-core 1.11's stricter config validation. dbt-core now validates all config keys against a JSON schema (https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/jsonschemas/resources/latest.json) to warn users about deprecated or unknown config keys.
The zorder config key was introduced to dbt-databricks in version 1.4.3 (April 19, 2023, ref: https://github.com/databricks/dbt-databricks/blob/main/CHANGELOG.md#dbt-databricks-143-april-19-2023) and is currently used in the optimize.sql macro to generate ZORDER BY clauses for table optimization.
Current workaround:
Users can suppress the warning by moving the zorder config to config.meta, and override the optimize macro, although this is not the intended location for this config:
config:
meta:
zorder: ["column1", "column2"]
However, this workaround is not ideal as meta is intended for custom metadata, not dbt-databricks-specific configurations.
Suggested solution:
The zorder config key should be registered with dbt-core's schema validation so it is recognized as a valid dbt-databricks config option. This will eliminate the deprecation warning while maintaining backward compatibility with existing code.
This sounds similar to deprecated warning in this issue
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue.
I have opened a PR on dbt-core on the fix. This warning should go away after the merge + compat release for dbt-databricks