acoustic-carpenter-78188
11/02/2023, 9:24 PMfrom 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/flyteacoustic-carpenter-78188
11/02/2023, 9:24 PM