diff --git a/docs/user_guide/data_types_and_io/dataclass.md b/docs/user_guide/data_types_and_io/dataclass.md index bb9372a3f8..ac2efe08e9 100644 --- a/docs/user_guide/data_types_and_io/dataclass.md +++ b/docs/user_guide/data_types_and_io/dataclass.md @@ -9,8 +9,14 @@ When you've multiple values that you want to send across Flyte entities, you can use a `dataclass`. Flytekit uses the [Mashumaro library](https://github.com/Fatal1ty/mashumaro) -to serialize and deserialize dataclasses. 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. By default, `flytekit >= 1.14` will produce `msgpack` bytes literals when serializing dataclasses. +to serialize and deserialize dataclasses. + +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. + +By default, `flytekit >= 1.14` will produce `msgpack` bytes literals when serializing dataclasses. :::{important} diff --git a/docs/user_guide/data_types_and_io/pydantic_basemodel.md b/docs/user_guide/data_types_and_io/pydantic_basemodel.md index 8864421c75..cdf6500fc4 100644 --- a/docs/user_guide/data_types_and_io/pydantic_basemodel.md +++ b/docs/user_guide/data_types_and_io/pydantic_basemodel.md @@ -14,7 +14,11 @@ Pydantic BaseModel V2 only works when you are using flytekit version >= v1.14.0. ::: 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. By default, `flytekit >= 1.14` will produce `msgpack` bytes literals when serializing dataclasses, preserving the types defined in your `BaseModel` class. +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. + +By default, `flytekit >= 1.14` will produce `msgpack` bytes literals when serializing dataclasses, preserving the types defined in your `BaseModel` class. :::{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`.