Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Dictionary key is unintentionally modified by Flyte when using custom python objects to configure tasks #3068

Closed
2 tasks done
fg91 opened this issue Nov 14, 2022 · 2 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers ui Admin console user interface
Milestone

Comments

@fg91
Copy link
Member

fg91 commented Nov 14, 2022

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:

@dataclass_json
@dataclass
class Hyperparams(object):
    param_dict: Dict[str, str]  # Used e.g. to pass additional kwargs
    # ... more hyper parameters
@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: 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
@fg91 fg91 added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Nov 14, 2022
@wild-endeavor wild-endeavor added the ui Admin console user interface label Jan 6, 2023
@wild-endeavor
Copy link
Contributor

@jsonporter could you take a look at this please? it looks to be localized to the UI.

@cosmicBboy cosmicBboy added this to the 1.4.0 milestone Feb 6, 2023
@cosmicBboy cosmicBboy added good first issue Good for newcomers and removed untriaged This issues has not yet been looked at by the Maintainers labels Feb 6, 2023
@jsonporter
Copy link

Closed with flyteorg/flyteconsole#692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers ui Admin console user interface
Projects
None yet
Development

No branches or pull requests

5 participants