Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behavior for external path #823

Merged
merged 7 commits into from
Oct 11, 2024
Merged

Behavior for external path #823

merged 7 commits into from
Oct 11, 2024

Conversation

benc-db
Copy link
Collaborator

@benc-db benc-db commented Oct 11, 2024

Resolves #812

Description

Adding config to have dbt-databricks add catalog and schema information to the path of external tables, to reduce the likelihood of conflicts arising from tables with the same name. This is a huge pain in testing, but not sure if others hit this in the wild, hence why default is to not do this behavior. We probably should have always been doing this, but it could potentially break existing workflows, another reason to default to False.

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.

@@ -112,6 +112,7 @@ class DatabricksConfig(AdapterConfig):
file_format: str = "delta"
table_format: TableFormat = TableFormat.DEFAULT
location_root: Optional[str] = None
include_full_name_in_path: bool = False
Copy link
Collaborator

Choose a reason for hiding this comment

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

can it be moved to the last argument to be backward compatible if someone calls w/o named arguments

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Normally I would agree with you, however...

Configs are never invoked with named arguments, as they are not actually exposed to users. Instead, users provide config via yaml, which dbt bundles together into a generic config object, which gets cast for type-checking purposes. This process is generic, i.e. dbt is also not invoking DatabricksConfig with named arguments. The primary reason to add fields here is to get code completion support, since basically all config provided by user (through yaml file) ends up available on the config object, and if you add the field here, then your IDE knows it will be on the object. Given that, it is more valuable to keep config fields that are related close together than to worry about ordering.

@benc-db benc-db merged commit 00dd9f8 into 1.9.latest Oct 11, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants