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

Selectors in docs generate limits catalog generation #8772

Merged
merged 7 commits into from
Oct 5, 2023

Conversation

gshank
Copy link
Contributor

@gshank gshank commented Oct 4, 2023

resolves #6014

Problem

Catalog generation is expensive, so we want to limit catalog queries to only the selected nodes.

Solution

Retrieve the selected node unique_ids and pass them to the methods used to get the catalog information.

Docs

In the past using a selector on docs generate would only affect which nodes were compiled. With this change, selectors will limit the information in the catalog.json.

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

@gshank gshank added the user docs [docs.getdbt.com] Needs better documentation label Oct 4, 2023
@gshank gshank requested review from a team as code owners October 4, 2023 21:07
@gshank gshank requested review from Fleid and MichelleArk October 4, 2023 21:07
@cla-bot cla-bot bot added the cla:yes label Oct 4, 2023
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (c6ff3ab) 86.50% compared to head (140b655) 86.50%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8772      +/-   ##
==========================================
- Coverage   86.50%   86.50%   -0.01%     
==========================================
  Files         176      176              
  Lines       25821    25841      +20     
==========================================
+ Hits        22337    22354      +17     
- Misses       3484     3487       +3     
Flag Coverage Δ
integration 83.25% <85.18%> (-0.03%) ⬇️
unit 65.09% <37.03%> (-0.04%) ⬇️

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

Files Coverage Δ
core/dbt/task/generate.py 86.70% <90.00%> (+0.13%) ⬆️
core/dbt/adapters/base/impl.py 81.79% <82.35%> (-0.16%) ⬇️

... and 1 file with indirect coverage changes

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

Copy link
Contributor

@peterallenwebb peterallenwebb left a comment

Choose a reason for hiding this comment

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

Looks good!

@gshank gshank merged commit f302933 into main Oct 5, 2023
60 checks passed
@gshank gshank deleted the 6014-use_select_in_docs_generate branch October 5, 2023 20:00
@FishtownBuildBot
Copy link
Collaborator

Opened a new issue in dbt-labs/docs.getdbt.com: dbt-labs/docs.getdbt.com#4203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes user docs [docs.getdbt.com] Needs better documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-1303] Respect node selection in catalog queries run by docs generate
3 participants