dask / dask/distributed

Can't serialize functions decorated with `@span`

Open
#7,954 2 comments 2 reactions 0 assignees View on GitHub
bug p3
Dominant language
Python
Stars
1.7k
Forks
778
Avg merge
2h 50m
Merged PRs (30d)
3

Description

This gives me an error:

```python

import distributed
from distributed.spans import span

client = distributed.Client()

@span("my-double")
def double(x):
return x * 2

X = client.map(double, range(10))
```

I get

```
TypeError: ('Could not serialize object of type HighLevelGraph', '\n 0. 6029444544\n>')
```

This is with dask and distributed `2023.6.2a230627`, installed from `dask/label/dev`, as well as `2023.6.1` and `2023.6.0`.

Am I supposed to be able to do this? Or am I doing something wrong? The same code minus the `@span` decorator works.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.