Skip to content

Commit

Permalink
incorporate_indirect_nodes should pass if not needed (#4214)
Browse files Browse the repository at this point in the history
* Pass incorporate_indirect_nodes if not needed

* Fix flake8

* Add changelog entry
  • Loading branch information
jtcohen6 authored Nov 5, 2021
1 parent c7bc6eb commit 3dab058
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
### Features
- Allow nullable `error_after` in source freshness ([#3874](https://github.com/dbt-labs/dbt-core/issues/3874), [#3955](https://github.com/dbt-labs/dbt-core/pull/3955))
- Increase performance of graph subset selection ([#4135](https://github.com/dbt-labs/dbt-core/issues/4135),[#4155](https://github.com/dbt-labs/dbt-core/pull/4155))
- Speed up node selection by skipping indirect node incorporation when not needed ([#4213](https://github.com/dbt-labs/dbt-core/issues/4213),[#4214](https://github.com/dbt-labs/dbt-core/pull/4214))

### Fixes
- Changes unit tests using `assertRaisesRegexp` to `assertRaisesRegex`

### Under the hood
- Bump artifact schema versions for 1.0.0: manifest v4, run results v4, sources v3. Notable changes: schema test + data test nodes are renamed to generic test + singular test nodes; freshness threshold default values ([#4191](https://github.com/dbt-labs/dbt-core/pull/4191))
- Speed up node selection by skipping `incorporate_indirect_nodes` if not needed ([#4213](https://github.com/dbt-labs/dbt-core/issues/4213), [#4214](https://github.com/dbt-labs/dbt-core/issues/4214))

Contributors:
- [@kadero](https://github.com/kadero) ([3955](https://github.com/dbt-labs/dbt-core/pull/3955))
Expand Down
4 changes: 4 additions & 0 deletions core/dbt/graph/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ def incorporate_indirect_nodes(
# Check tests previously selected indirectly to see if ALL their
# parents are now present.

# performance: if identical, skip the processing below
if set(direct_nodes) == set(indirect_nodes):
return direct_nodes

selected = set(direct_nodes)

for unique_id in indirect_nodes:
Expand Down

0 comments on commit 3dab058

Please sign in to comment.