<#3011 [BUG] Annotated StructuredDataset with kwty...
# flyte-github
a
#3011 [BUG] Annotated StructuredDataset with kwtypes leads raises TypeError Issue created by cosmicBboy Describe the bug Using an
Annotated[StructuredDataset, kwtypes(...)]
leads to this error:
Copy code
return cast(LocallyExecutable, entity).local_execute(ctx, **kwargs)
  File "/Users/nielsbantilan/miniconda3/envs/flyte-vscode-demo/lib/python3.9/site-packages/flytekit/core/base_task.py", line 264, in local_execute
    outputs_literal_map = self.dispatch_execute(ctx, input_literal_map)
  File "/Users/nielsbantilan/miniconda3/envs/flyte-vscode-demo/lib/python3.9/site-packages/flytekit/core/base_task.py", line 525, in dispatch_execute
    raise TypeError(
TypeError: Failed to convert return value for var o0 for function prepare_train_args with error <class 'TypeError'>: unhashable type: 'collections.OrderedDict'
Expected behavior This should work like un-annotated
StructuredDataset
Additional context to reproduce Example:
Copy code
WineDataset = Annotated[
    StructuredDataset,
    kwtypes(
        alcohol=float,
        malic_acid=float,
        ash=float,
        alcalinity_of_ash=float,
        magnesium=float,
        total_phenols=float,
        flavanoids=float,
        nonflavanoid_phenols=float,
        proanthocyanins=float,
        color_intensity=float,
        hue=float,
        od280_od315_of_diluted_wines=float,
        proline=float,
        target=int,
    )
]

@dataclass_json
@dataclass
class TrainArgs:
    hyperparameters: dict
    data: WineDataset

@task
def prepare_train_args(hp_grid: List[dict], data: WineDataset) -> List[TrainArgs]:
    return [TrainArgs(hp, data) for hp in hp_grid]
Using this in a workflow 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/flyte