-
Notifications
You must be signed in to change notification settings - Fork 671
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
[Docs] MessagePack IDL, Pydantic Support, and Attribute Access #6022
Conversation
Signed-off-by: Future-Outlier <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6022 +/- ##
==========================================
+ Coverage 37.03% 37.07% +0.04%
==========================================
Files 1313 1316 +3
Lines 131622 132191 +569
==========================================
+ Hits 48742 49007 +265
- Misses 78652 78922 +270
- Partials 4228 4262 +34
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Signed-off-by: Future-Outlier <[email protected]>
|
||
Flytekit version >= v1.14.0 will produce msgpack bytes literal for dataclasses. | ||
|
||
If you're using Flytekit version >= v1.14.0 and you want to produce protobuf struct literal for dataclasses, you can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to mention why would a user want to produce protobuf struct literal instead of msgpack bytes
.. tags:: Basic | ||
``` | ||
|
||
When you've multiple values that you want to send across Flyte entities, and you want them to have, you can use a `pydantic.BaseModel`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
@Future-Outlier left some suggestions to improve clarity. I hope it helps |
Co-authored-by: David Espejo <[email protected]> Signed-off-by: Han-Ru Chen (Future-Outlier) <[email protected]>
Co-authored-by: David Espejo <[email protected]> Signed-off-by: Han-Ru Chen (Future-Outlier) <[email protected]>
thank you so much David, will finish this today |
Co-authored-by: David Espejo <[email protected]> Signed-off-by: Han-Ru Chen (Future-Outlier) <[email protected]>
Co-authored-by: David Espejo <[email protected]> Signed-off-by: Han-Ru Chen (Future-Outlier) <[email protected]>
Co-authored-by: David Espejo <[email protected]> Signed-off-by: Han-Ru Chen (Future-Outlier) <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
With the 1.14 release, `flytekit` adopted `MessagePack` as the | ||
serialization format for dataclasses, overcoming a major limitation of serialization into a JSON string within a Protobuf `struct` datatype, like the previous versions do: | ||
|
||
to store `int` types, Protobuf's `struct` converts them to `float`, forcing users to write boilerplate code to work around this issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to insert a new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think insert a new line is more readable
By default, `flytekit >= 1.14` will produce `msgpack` bytes literals when serializing dataclasses. | ||
|
||
:::{important} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, `flytekit >= 1.14` will produce `msgpack` bytes literals when serializing dataclasses. |
:::{important} | ||
|
||
If you're serializing dataclasses using `flytekit` version >= v1.14.0, and you want to produce Protobuf `struct | ||
literal` instead, you can set environment variable `FLYTE_USE_OLD_DC_FORMAT` to `true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to insert a new line, I think it breaks the code format
Flytekit version < v1.14.0 will produce protobuf struct literal for dataclasses. | ||
|
||
Flytekit version >= v1.14.0 will produce msgpack bytes literal for dataclasses. | ||
|
||
If you're using Flytekit version >= v1.14.0 and you want to produce protobuf struct literal for dataclasses, you can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flytekit version < v1.14.0 will produce protobuf struct literal for dataclasses. | |
Flytekit version >= v1.14.0 will produce msgpack bytes literal for dataclasses. | |
If you're using Flytekit version >= v1.14.0 and you want to produce protobuf struct literal for dataclasses, you can |
Flytekit version >= v1.14.0 will produce msgpack bytes literal for dataclasses. | ||
|
||
If you're using Flytekit version >= v1.14.0 and you want to produce protobuf struct literal for dataclasses, you can | ||
set environment variable `FLYTE_USE_OLD_DC_FORMAT` to `true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set environment variable `FLYTE_USE_OLD_DC_FORMAT` to `true`. |
This was already mentioned above
Also in the readthedocs build, you can see there are two important
blocks nested
``` | ||
|
||
`flytekit` version >=1.14 supports natively the `JSON` format that Pydantic `BaseModel` produces, enhancing the | ||
interoperability of Pydantic BaseModels with the Flyte type system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to insert new line
|
||
With the 1.14 release, `flytekit` adopted `MessagePack` as the serialization format for Pydantic `BaseModel`, | ||
overcoming a major limitation of serialization into a JSON string within a Protobuf `struct` datatype like the previous versions do: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the 1.14 release, `flytekit` adopted `MessagePack` as the serialization format for Pydantic `BaseModel`, | ||
overcoming a major limitation of serialization into a JSON string within a Protobuf `struct` datatype like the previous versions do: | ||
|
||
to store `int` types, Protobuf's `struct` converts them to `float`, forcing users to write boilerplate code to work around this issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think new line after a colon (unless a list) looks strange
@Future-Outlier thank you for your patience. A few more suggestions, plus please make sure there are no nested |
Co-authored-by: David Espejo <[email protected]> Signed-off-by: Han-Ru Chen (Future-Outlier) <[email protected]>
Co-authored-by: David Espejo <[email protected]> Signed-off-by: Han-Ru Chen (Future-Outlier) <[email protected]>
Co-authored-by: David Espejo <[email protected]> Signed-off-by: Han-Ru Chen (Future-Outlier) <[email protected]>
Co-authored-by: David Espejo <[email protected]> Signed-off-by: Han-Ru Chen (Future-Outlier) <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
Docs link
Tracking issue
#5318