()
| 878 | |
| 879 | |
| 880 | def test_annotations_survive_optimization(): |
| 881 | with dask.annotate(foo="bar"): |
| 882 | graph = HighLevelGraph.from_collections( |
| 883 | "b", |
| 884 | {"a": 1, "b": (inc, "a"), "c": (inc, "b")}, |
| 885 | [], |
| 886 | ) |
| 887 | d = Delayed("b", graph) |
| 888 | |
| 889 | assert type(d.dask) is HighLevelGraph |
| 890 | assert len(d.dask.layers) == 1 |
| 891 | assert len(d.dask.layers["b"]) == 3 |
| 892 | assert d.dask.layers["b"].annotations == {"foo": "bar"} |
| 893 | optimized = collections_to_expr([d]).optimize() |
| 894 | assert optimized.__dask_annotations__() == { |
| 895 | "foo": dict.fromkeys(optimized.__dask_graph__(), "bar") |
| 896 | } |
| 897 | |
| 898 | |
| 899 | def test_delayed_function_attributes_forwarded(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…