MCPcopy Create free account
hub / github.com/dask/dask / _get_some_layer_name

Function _get_some_layer_name

dask/highlevelgraph.py:1002–1010  ·  view source on GitHub ↗

Somehow get a unique name for a Layer from a non-HighLevelGraph dask mapping

(collection)

Source from the content-addressed store, hash-verified

1000
1001
1002def _get_some_layer_name(collection) -> str:
1003 """Somehow get a unique name for a Layer from a non-HighLevelGraph dask mapping"""
1004 try:
1005 (name,) = collection.__dask_layers__()
1006 return name
1007 except (AttributeError, ValueError):
1008 # collection does not define the optional __dask_layers__ method
1009 # or it spuriously returns more than one layer
1010 return str(id(collection))
1011
1012
1013@normalize_token.register(HighLevelGraph)

Callers 2

_from_collectionMethod · 0.85
from_collectionsMethod · 0.85

Calls 1

__dask_layers__Method · 0.45

Tested by

no test coverage detected