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] Integer type cannot be reserved when changing python dict type to struct_pb2 #2880

Closed
2 tasks done
highfly22 opened this issue Sep 14, 2022 · 6 comments
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@highfly22
Copy link

Describe the bug

If I pass an argument as dict, then the argument can not be reserved the integer type. So I have to use YAML string directly.

>>> from flytekit.core.type_engine import DictTransformer
>>> DictTransformer.dict_to_generic_literal({'a' : 1})
scalar {
  generic {
    fields {
      key: "a"
      value {
        number_value: 1.0
      }
    }
  }
}

Expected behavior

I expect the result of the following code is integer 1 not float 1.0.

Additional context to reproduce

No response

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@highfly22 highfly22 added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Sep 14, 2022
@welcome
Copy link

welcome bot commented Sep 14, 2022

Thank you for opening your first issue here! 🛠

@eapolinario eapolinario self-assigned this Sep 17, 2022
@eapolinario
Copy link
Contributor

@highfly22 , can you expand on the problem here? In what context are you using the DictTransformer directly? Maybe give an example of how you're seeing this behavior.

@eapolinario eapolinario removed the untriaged This issues has not yet been looked at by the Maintainers label Sep 17, 2022
@highfly22
Copy link
Author

@highfly22 , can you expand on the problem here? In what context are you using the DictTransformer directly? Maybe give an example of how you're seeing this behavior.

I parse a YAML configuration file to dict, then pass it as context argument. The configuration contains some integer data. When I try to access the integer data, an invalid parameter exception is raised. Because the integer data has been casted to a float value.

So I make a new Class to wrapper the configuration, and serialize it into a string.

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

Hello 👋, This issue has been inactive for over 9 months. To help maintain a clean and focused backlog, we'll be marking this issue as stale and will close the issue if we detect no activity in the next 7 days. Thank you for your contribution and understanding! 🙏

@github-actions github-actions bot added the stale label Sep 4, 2023
@github-actions
Copy link

Hello 👋, This issue has been inactive for over 9 months and hasn't received any updates since it was marked as stale. We'll be closing this issue for now, but if you believe this issue is still relevant, please feel free to reopen it. Thank you for your contribution and understanding! 🙏

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
@eapolinario eapolinario reopened this Nov 2, 2023
@github-actions github-actions bot removed the stale label Nov 4, 2023
@eapolinario
Copy link
Contributor

Closing this in favor of #4505.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants