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

generalize BaseConfig.update_from + call adapter factory methods in core #9335

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Jan 4, 2024

resolves #9334

Problem

  • BaseConfig.update_from in dbt/common was using a method imported from dbt.adapter to convert an adapter type -> its config class. This would represent a circular dependency once dbt/common is moved out of dbt-core and into an upstream package

Solution

  • call the dbt.adpater method in dbt.core (which can depend on dbt.adapter) and pass the resulting config class to the update_from call

Checklist

  • I have read the contributing guide and understand what's expected of me
  • 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
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX
  • This PR includes type annotations for new and modified functions

@cla-bot cla-bot bot added the cla:yes label Jan 4, 2024
Copy link

codecov bot commented Jan 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e42b7ca) 86.64% compared to head (3a7fe51) 86.58%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9335      +/-   ##
==========================================
- Coverage   86.64%   86.58%   -0.06%     
==========================================
  Files         221      221              
  Lines       26997    26999       +2     
==========================================
- Hits        23391    23377      -14     
- Misses       3606     3622      +16     
Flag Coverage Δ
integration 83.46% <100.00%> (-0.12%) ⬇️
unit 65.21% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MichelleArk MichelleArk marked this pull request as ready for review January 4, 2024 19:45
@MichelleArk MichelleArk requested a review from a team as a code owner January 4, 2024 19:45
"""Given a dict of keys, update the current config from them, validate
it, and return a new config with the updated values
"""
# sadly, this is a circular import
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was sad!

@MichelleArk MichelleArk merged commit 125982a into main Jan 5, 2024
56 checks passed
@MichelleArk MichelleArk deleted the remove-get-adapter-config-class-from-common branch January 5, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-3524] Remove usage of dbt.adapters.factory in dbt/common
2 participants