[CT-1303] Respect node selection in catalog queries run by docs generate
#6014
Labels
enhancement
New feature or request
node selection
Functionality and syntax for selecting DAG nodes
performance
Team:Adapters
Issues designated for the adapter area of the code
user docs
[docs.getdbt.com] Needs better documentation
When users specify
dbt docs generate --select <selection_criteria>
, that limits the set of project resources for which dbt will generate compile SQL. This is implicit behavior in theGenerateTask
, because it inherits from theCompileTask
, where that behavior is defined.We should additionally make
docs generate
respect node selection for the purposes of generating catalogs, which can be very very expensive.To really have an effect, this change would want to be paired with #4997, which would filter down our catalog queries to only the ones that are actually selected. Without that change, while we would successfully limit ourselves to cataloging metadata on only the schema(s) containing the selected resource(s), we'd still catalog the entire schema, which could include hundreds/thousands of unrelated resources.
Use case
dbt run --select my_one_model
dbt docs generate --select my_one_model
Technical implementation
get_node_selector
, plus selectedsources
) intoadapter.get_catalog
hereadapter._get_catalog_schemas
accessingmanifest.nodes
andmanifest.sources
directly, it should limit itself to the nodes/sources actually included in the selection logicNote
To be clear, this would not accomplish what users tend to ask for when asking for more powerful
docs generate --select
, which is to produce amanifest.json
with only the selected resources. Relevant discussions: #5096, #5244The text was updated successfully, but these errors were encountered: