Skip to content

Commit

Permalink
Use HighLevelGraph.merge in collections_to_dsk (#6836)
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Nov 13, 2020
1 parent aeb7815 commit 1e0a9a1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions dask/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ def collections_to_dsk(collections, optimize_graph=True, **kwargs):
"""
Convert many collections into a single dask graph, after optimization
"""
from .highlevelgraph import HighLevelGraph

optimizations = kwargs.pop("optimizations", None) or config.get("optimizations", [])

if optimize_graph:
Expand All @@ -284,12 +286,11 @@ def collections_to_dsk(collections, optimize_graph=True, **kwargs):
_opt_list.append(_opt)
groups = group

dsk = merge(
*map(
ensure_dict,
_opt_list,
)
)
# Merge all graphs
if any(isinstance(graph, HighLevelGraph) for graph in _opt_list):
dsk = HighLevelGraph.merge(*_opt_list)
else:
dsk = merge(*map(ensure_dict, _opt_list))
else:
dsk, _ = _extract_graph_and_keys(collections)

Expand Down

0 comments on commit 1e0a9a1

Please sign in to comment.