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] Relaunch workflow converts large numbers in array of structs to objects. #5424

Open
2 tasks done
njubatyrov opened this issue May 28, 2024 · 6 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working ui Admin console user interface

Comments

@njubatyrov
Copy link

njubatyrov commented May 28, 2024

Describe the bug

When relaunching a workflow in FlyteConsole, large numbers within an array of structs are incorrectly converted into objects. For example, 1716759253199713 will become { "low": 695446369, "high": 399714, "unsigned": false }. This issue specifically occurs when the value of a key within the struct of an array is a large number, such as a Unix timestamp in microseconds.

The root cause appears to be in the parseJson.ts of flyteconsole repo. This file parses JSON and returns a Long type for large numbers. However, when this Long type is included when pressing "Relaunch" button, it is not correctly serialised and thus potentially causing unexpected behaviour.

Expected behavior

When relaunching a workflow, the input data should be accurately populated in the text area prior to launch.

Additional context to reproduce

  1. Create a workflow where the input arguments are a collection of objects, and one of the key/value pairs is an integer that overflows JavaScript's Number type.
  2. Once the job is complete, click "Relaunch". You will observe that the value has been converted into an object.

Screenshots

Screenshot of an input, observe the value of bar key:
input-data

Screen of an input when pressing "Relaunch", observe the value turned into object:
relaunch-data

No response

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

  • Yes

Have you read the Code of Conduct?

  • Yes
@njubatyrov njubatyrov added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels May 28, 2024
Copy link

welcome bot commented May 28, 2024

Thank you for opening your first issue here! 🛠

Copy link

runllm bot commented May 28, 2024

The issue you described seems to be related to how FlyteConsole handles large numbers during JSON parsing and serialization. Specifically, the Long type used for large numbers is not correctly serialized when relaunching workflows, leading to unexpected behavior.

Would you like more details on how to address this issue, including potential code snippets and further

Sources:


This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.

Mention @RunLLM to ask follow-up questions. See runllm.com for more!

@eapolinario eapolinario added ui Admin console user interface and removed untriaged This issues has not yet been looked at by the Maintainers labels May 30, 2024
@eapolinario
Copy link
Contributor

cc: @jsonporter , can you take a look? This seems to be particular to the browser javascript, but maybe we can catch this error earlier?

@kumare3
Copy link
Contributor

kumare3 commented Jun 6, 2024

@eapolinario / @jsonporter this is actually a struct and a json type. @njubatyrov If you use Flyte native float or int it does work right as seen below.
Screenshot 2024-06-05 at 11 39 14 AM

The problem is possibly with json schemas in the return

@njubatyrov
Copy link
Author

@kumare3

The issue only happens when you have an input as an array of dataclass objects which is converted to struct.

@kumare3
Copy link
Contributor

kumare3 commented Sep 11, 2024

@njubatyrov we are working on an complete JSON overhaul in flyte - follow the issue - #5318

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

No branches or pull requests

4 participants