<#2895 [BUG] Dataclass becomes empty after running...
# flytekit
a
#2895 [BUG] Dataclass becomes empty after running ray remote function Issue created by pingsutw Describe the bug Slack thread Failed to serialize dataclass because the value became empty for some reason after running ray remote function Expected behavior Successfully serialize the dataclass Additional context to reproduce
Copy code
from dataclasses import dataclass
from typing import cast
from dataclasses_json import dataclass_json, DataClassJsonMixin
import ray


@dataclass_json
@dataclass
class Datum(object):
    x: int
    y: str


@ray.remote
def ray_create_datum(x: int, y: str):
    return Datum(x=x, y=y)


d = Datum(x=1, y='hello')

print("value", cast(DataClassJsonMixin, d).to_json()) # value {"x": 1, "y": "hello"}
ray.get(ray_create_datum.remote(x=1, y='hello'))
print("value", cast(DataClassJsonMixin, d).to_json()) # value {}
Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte