Skip to content

feat: Enhance manifest reference resolution and add tests for config … - #162

Merged
adrienneyager merged 1 commit into
adrienneyager:mainfrom
PhilippLange:fix/databricks-config-parsing
Mar 21, 2026
Merged

adrienneyager merged 1 commit into
adrienneyager:mainfrom
PhilippLange:fix/databricks-config-parsing

Conversation

@PhilippLange

@PhilippLange PhilippLange commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

my attempt to fix #161.
I tested this on macos and windows.

The Issue was, that Pydantic resolves Unions by trying each type in order, returning the first match.

Since both FileReferenceConfig and DatabricksReferenceConfig have a path field and FileReferenceConfig is listed first — so Databricks configs were silently parsed as file configs:
https://github.com/nicholasyager/dbt-loom/blob/d0b89e62b8a12d560a4686a8ad6b21a0ef9b78fe/dbt_loom/config.py#L57-L66

Resulting in:
FileReferenceConfig then runs Path(v).absolute().as_uri(), which on Windows prepends C:/ to the Databricks volume path.

@PhilippLange
PhilippLange force-pushed the fix/databricks-config-parsing branch from 366b44a to 651d940 Compare March 19, 2026 09:50
@PhilippLange
PhilippLange force-pushed the fix/databricks-config-parsing branch from 651d940 to 26dd345 Compare March 19, 2026 09:52
@adrienneyager
adrienneyager self-requested a review March 21, 2026 01:36
@adrienneyager adrienneyager added the bug Something isn't working label Mar 21, 2026

@adrienneyager adrienneyager left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the meaningful improvement, @PhilippLange! Approved ✅

Comment thread dbt_loom/config.py
"""
ref_type = info.data.get("type")
if ref_type is not None and isinstance(v, dict):
config_cls = _TYPE_TO_CONFIG.get(ref_type)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise: I quite like the explicit factory approach for picking the config type. Thanks for adding this.

manifest_loader.load(manifest_reference)


def test_manifest_reference_resolves_databricks_config():

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise: Kudos for adding tests.

@adrienneyager
adrienneyager merged commit c54b991 into adrienneyager:main Mar 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config path parsing on windows machines

2 participants