feat: declare CATALOG_V2_CONFIGS for catalogs.yml v2 support#1440
Draft
aahel wants to merge 5 commits intodatabricks:mainfrom
Draft
feat: declare CATALOG_V2_CONFIGS for catalogs.yml v2 support#1440aahel wants to merge 5 commits intodatabricks:mainfrom
aahel wants to merge 5 commits intodatabricks:mainfrom
Conversation
Adds UnityDatabricksConfig and HiveMetastoreDatabricksConfig dataclasses and declares them on DatabricksAdapter.CATALOG_V2_CONFIGS. This enables parse-time validation of catalogs.yml v2 when the use_catalogs_v2 behavior flag is set in dbt-core. UnityDatabricksConfig enforces file_format='parquet' when use_uniform is false/unset, and 'delta' when use_uniform=true. HiveMetastoreDatabricksConfig accepts delta, parquet, or hudi. Both schemas are dbtClassMixin dataclasses — structural validation (unknown keys, required fields) via jsonschema; semantic constraints in __post_init__.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
UnityDatabricksConfigandHiveMetastoreDatabricksConfigschema dataclasses and declares them onDatabricksAdapter.CATALOG_V2_CONFIGSto support catalogs.yml v2 parse-time validation for Databricks catalog types.What changed
New file:
dbt/adapters/databricks/catalogs/_v2.pyUnityDatabricksConfig— validates theconfig.databricksblock fortype: unity. Enforcesfile_format='parquet'whenuse_uniformis false/unset,'delta'whenuse_uniform=true.HiveMetastoreDatabricksConfig— validatesconfig.databricksfortype: hive_metastore. Acceptsdelta,parquet, orhudi.dbt/adapters/databricks/impl.pyTests
15 unit tests covering registration, valid inputs,
use_uniform/file_formatcross-field constraint, and invalid inputs.