acoustic-carpenter-78188
10/11/2023, 4:28 AMpd.DataFrame
with dataclasses raises an error:
File "/Users/nielsbantilan/miniconda3/envs/flyte-vscode-demo/lib/python3.9/site-packages/dataclasses_json/core.py", line 201, in _decode_dataclass
init_kwargs[field.name] = _decode_generic(field_type,
File "/Users/nielsbantilan/miniconda3/envs/flyte-vscode-demo/lib/python3.9/site-packages/dataclasses_json/core.py", line 258, in _decode_generic
xs = _decode_items(type_.__args__[0], value, infer_missing)
AttributeError: type object 'DataFrame' has no attribute '__args__'
Expected behavior
this should work like structured dataset
Additional context to reproduce
Using this type in a task
@dataclass_json
@dataclass
class TrainArgs:
hyperparameters: dict
data: pd.DataFrame
@task
def prepare_train_args(hp_grid: List[dict], data: pd.DataFrame) -> List[TrainArgs]:
return [TrainArgs(hp, data) for hp in hp_grid]
will lead to the error above
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
10/11/2023, 4:28 AMacoustic-carpenter-78188
11/02/2023, 9:23 PM