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

[Core feature] Support for Native JSON types in flyte #5318

Open
2 tasks done
kumare3 opened this issue May 3, 2024 · 6 comments
Open
2 tasks done

[Core feature] Support for Native JSON types in flyte #5318

kumare3 opened this issue May 3, 2024 · 6 comments
Labels
backlogged For internal use. Reserved for contributor team workflow. enhancement New feature or request

Comments

@kumare3
Copy link
Contributor

kumare3 commented May 3, 2024

Motivation: Why do you think this is important?

Currently flyte supports JSON through protobuf Struct. This causes a lot of problems for the users, especially when using ints as Structs only store numbers - which are double values.

Goal: What should the final outcome look like, ideally?

Support a new FlyteIDL.LiteralType called LiteralType.JSON. So users can simply use any object that dumps to a JSON using binary / bytearray as the transport layer.

It should be possible to also have customer json serializers and deserializers for the data like JsonPickle etc

Describe alternatives you've considered

New literalType called LiteralType.JSON
This maps to a Literal of type binary (wire format)
Optionally the metadata / schema can be extracted and stored

Propose: Link/Inline OR Additional context

No response

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

  • Yes

Have you read the Code of Conduct?

  • Yes
@kumare3 kumare3 added enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers labels May 3, 2024
Copy link

runllm bot commented May 3, 2024

To support native JSON types in Flyte, you propose introducing a new LiteralType.JSON in FlyteIDL, using binary/bytearray for transport, and allowing custom JSON serializers/deserializers. This approach aims to address issues with current JSON handling via protobuf Struct, particularly with integer representation.

Would you like more detail on how to implement this feature or any potential challenges?

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!

@kumare3
Copy link
Contributor Author

kumare3 commented May 3, 2024

Related to #4505

@MortalHappiness
Copy link
Contributor

#take

@MortalHappiness MortalHappiness removed their assignment May 3, 2024
@thomasjpfan
Copy link
Member

From #4505 (comment), I see the follow Python types that can use Literal.JSON:

  1. dicts -> JsonPickle
  2. dataclasses -> Use Mashumuro's encoders/decorders or the object's to_json + from_json (These methods are defined with DataClassJSONMixin)

@kumare3 Are you considering other Python types that would use Literal.JSON?

@kumare3
Copy link
Contributor Author

kumare3 commented May 3, 2024

I am saying wholesale migration to json for these unsupported types from struct

@pingsutw pingsutw self-assigned this May 6, 2024
@wild-endeavor
Copy link
Contributor

#5337

@wild-endeavor wild-endeavor added backlogged For internal use. Reserved for contributor team workflow. and removed untriaged This issues has not yet been looked at by the Maintainers labels May 9, 2024
@pingsutw pingsutw removed their assignment May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlogged For internal use. Reserved for contributor team workflow. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants