MCPcopy Index your code
hub / github.com/dask/dask / test_inline_functions_non_hashable

Function test_inline_functions_non_hashable

dask/tests/test_optimization.py:299–313  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

297
298
299def test_inline_functions_non_hashable():
300 class NonHashableCallable:
301 def __call__(self, a):
302 return a + 1
303
304 def __hash__(self):
305 raise TypeError("Not hashable")
306
307 nohash = NonHashableCallable()
308
309 dsk = {"a": 1, "b": (inc, "a"), "c": (nohash, "b"), "d": (inc, "c")}
310
311 result = inline_functions(dsk, [], fast_functions={inc})
312 assert result["c"] == (nohash, dsk["b"])
313 assert "b" not in result
314
315
316def test_inline_doesnt_shrink_fast_functions_at_top():

Callers

nothing calls this directly

Calls 2

inline_functionsFunction · 0.90
NonHashableCallableClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…