<#3068 [BUG] Dictionary key is unintentionally mod...
# flyte-github
a
#3068 [BUG] Dictionary key is unintentionally modified by Flyte when using custom python objects to configure tasks Issue created by fg91 Describe the bug When configuring Flyte tasks with Python dataclasses and when using dictionaries within those dataclasses, flyte, under certain circumstances, replaces the name of the key with the name of the dictionary. Expected behavior Flyte should not modify the arguments. Additional context to reproduce Let's create a custom python dataclass to configure our task/workflow:
Copy code
@dataclass_json
@dataclass
class Hyperparams(object):
    param_dict: Dict[str, str]  # Used e.g. to pass additional kwargs
    # ... more hyper parameters
Copy code
@task
def train(
    hparams: Hyperparams,
) -> str:
    print(hparams)


@workflow
def workflow(
    hparams: Hyperparams = Hyperparams(
        param_dict={"foo": "bar"}
    ),

) -> None:
    train(
        hparams=hparams,
    )
Screenshots In the Flyteconsole, the name of the dict is displayed instead of the key:

Screenshot 2022-11-14 at 16 48 34

The workflow is started with the correct arguments ...

Screenshot 2022-11-14 at 16 49 03

... unless, in Flyteconsole, one puts the cursor into the
param_dict (string)
field:

Screenshot 2022-11-14 at 16 49 18

Screenshot 2022-11-14 at 16 49 39

I used
image: <http://cr.flyte.org/flyteorg/flyteconsole-release:v1.2.0|cr.flyte.org/flyteorg/flyteconsole-release:v1.2.0>
. Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte