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

remove manifest from adapter.get_catalog signature #9212

Closed

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Dec 5, 2023

resolves #9218

Problem

An entire manifest object is passed from core to adapters for catalog methods, when all that is needed is an iterable of ResultConfig protocols to create relations from, and a set of used schemas.

Solution

Refactor the generate task to pre-compute the list of catalogable relation configs + used schemas and pass those + plumb them through adapter methods instead of passing an overly broad manifest object through core -> adapters.

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
  • [ x] 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 Dec 5, 2023
Copy link
Contributor

github-actions bot commented Dec 5, 2023

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.

Copy link

codecov bot commented Dec 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ba53f05) 86.56% compared to head (0745c89) 86.62%.

Additional details and impacted files
@@                        Coverage Diff                        @@
##           relation-create-from-refactor    #9212      +/-   ##
=================================================================
+ Coverage                          86.56%   86.62%   +0.06%     
=================================================================
  Files                                215      215              
  Lines                              26862    26864       +2     
=================================================================
+ Hits                               23252    23270      +18     
+ Misses                              3610     3594      -16     
Flag Coverage Δ
integration 83.55% <100.00%> (+0.13%) ⬆️
unit 65.19% <73.68%> (-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 changed the title remove manifest from get_catalog method remove manifest from adapter.get_catalog signature Dec 5, 2023
@@ -1166,16 +1163,16 @@ def _get_one_catalog_by_relations(
table = self.execute_macro(
GET_CATALOG_RELATIONS_MACRO_NAME,
kwargs=kwargs,
# pass in the full manifest, so we get any local project
# overrides
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code is quite old, and I believe there is testing in place for this (will dig it up shortly) and that it is safe to remove at this point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

) -> agate.Table:
kwargs = {"information_schema": information_schema, "schemas": schemas}
table = self.execute_macro(
GET_CATALOG_MACRO_NAME,
kwargs=kwargs,
# pass in the full manifest so we get any local project
# overrides
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MichelleArk MichelleArk marked this pull request as ready for review December 5, 2023 15:22
@MichelleArk MichelleArk requested review from a team as code owners December 5, 2023 15:22
@MichelleArk MichelleArk requested review from colin-rogers-dbt and aranke and removed request for aranke December 5, 2023 15:22
Base automatically changed from relation-create-from-refactor to feature/decouple-adapters-from-core December 6, 2023 18:46
@MichelleArk
Copy link
Contributor Author

Closing in favor of: #9242

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.

1 participant