-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maximally parallelize dbt clone (#10129)
- Loading branch information
1 parent
366d4ad
commit fb10bb4
Showing
9 changed files
with
172 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Features | ||
body: Maximally parallelize dbt clone | ||
in clone command" | ||
time: 2024-05-22T00:03:09.765977-04:00 | ||
custom: | ||
Author: michelleark | ||
Issue: "7914" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import networkx as nx | ||
import pytest | ||
|
||
from dbt.contracts.graph.manifest import Manifest | ||
from dbt.graph.queue import GraphQueue | ||
from tests.unit.utils import MockNode, make_manifest | ||
|
||
|
||
class TestGraphQueue: | ||
@pytest.fixture(scope="class") | ||
def manifest(self) -> Manifest: | ||
return make_manifest( | ||
nodes=[ | ||
MockNode(package="test_package", name="upstream_model"), | ||
MockNode(package="test_package", name="downstream_model"), | ||
] | ||
) | ||
|
||
@pytest.fixture(scope="class") | ||
def graph(self) -> nx.DiGraph: | ||
graph = nx.DiGraph() | ||
graph.add_edge("model.test_package.upstream_model", "model.test_package.downstream_model") | ||
return graph | ||
|
||
def test_init_graph_queue(self, manifest, graph): | ||
graph_queue = GraphQueue(graph=graph, manifest=manifest, selected={}) | ||
|
||
assert graph_queue.manifest == manifest | ||
assert graph_queue.graph == graph | ||
assert graph_queue.inner.queue == [(0, "model.test_package.upstream_model")] | ||
assert graph_queue.in_progress == set() | ||
assert graph_queue.queued == {"model.test_package.upstream_model"} | ||
assert graph_queue.lock | ||
|
||
def test_init_graph_queue_preserve_edges_false(self, manifest, graph): | ||
graph_queue = GraphQueue(graph=graph, manifest=manifest, selected={}, preserve_edges=False) | ||
|
||
# when preserve_edges is set to false, dependencies between nodes are no longer tracked in the priority queue | ||
assert list(graph_queue.graph.edges) == [] | ||
assert graph_queue.inner.queue == [ | ||
(0, "model.test_package.downstream_model"), | ||
(0, "model.test_package.upstream_model"), | ||
] | ||
assert graph_queue.queued == { | ||
"model.test_package.upstream_model", | ||
"model.test_package.downstream_model", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters