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

Support for dbt core changes to support mashumaro 3.15 #228

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

gshank
Copy link
Contributor

@gshank gshank commented Dec 5, 2024

Supports dbt-labs/dbt-core#11051

Description

Changes to validate config dicts prior to instantiating config objects with "from_dict".

Checklist

@gshank gshank requested a review from a team as a code owner December 5, 2024 16:35
@cla-bot cla-bot bot added the cla:yes label Dec 5, 2024
Copy link

github-actions bot commented Dec 5, 2024

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

Given a dict of keys, update the current config from them, validate
it, and return a new config with the updated values
"""
# dct = self.to_dict(omit_none=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: this probably should be cleaned up

@@ -115,6 +115,28 @@ def same_contents(cls, unrendered: Dict[str, Any], other: Dict[str, Any]) -> boo
"object": ["snapshot_meta_column_names"],
}

@classmethod
def update_from(
cls, dct: Dict[str, Any], data: Dict[str, Any], adapter_config_cls: Type[BaseConfig]
Copy link
Collaborator

Choose a reason for hiding this comment

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

naming nit: is there naming here that would better signify the difference between dct and data?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you have any suggestions? orig_dict, new_dict?

@@ -150,30 +172,6 @@ def _merge_dicts(cls, src: Dict[str, Any], data: Dict[str, Any]) -> Dict[str, An
)
return result

def update_from(
Copy link
Collaborator

Choose a reason for hiding this comment

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

there don't appear to be explicit usages of update_from in dbt-adapters: https://github.com/search?q=repo%3Adbt-labs%2Fdbt-adapters%20update_from&type=code

Copy link
Collaborator

Choose a reason for hiding this comment

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

The signature change here looks like it will have a very minor impact (just to dbt-core). We could release a dbt-common major version bump for this change since it is technically breaking, but that might be overkill given its low usage. At least a minor bump makes sense to me though.

@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.69%. Comparing base (243568e) to head (d77bfa8).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #228      +/-   ##
==========================================
- Coverage   68.89%   68.69%   -0.20%     
==========================================
  Files          52       52              
  Lines        3433     3434       +1     
==========================================
- Hits         2365     2359       -6     
- Misses       1068     1075       +7     
Flag Coverage Δ
unit 68.69% <100.00%> (-0.20%) ⬇️

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.

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.

3 participants