Somehow get a unique name for a Layer from a non-HighLevelGraph dask mapping
(collection)
| 1000 | |
| 1001 | |
| 1002 | def _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) |
no test coverage detected