-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override Dataclass Serialization/Deserialization Behavior for `FlyteT…
…ypes` by `mashumaro` (#2554) * Add to_json and from_json to Flyte type Signed-off-by: Future-Outlier <[email protected]> * Add to_json and from_json to Flyte type Signed-off-by: Future-Outlier <[email protected]> * remove call of self._serialize_flyte_type in dataclass transformer to_literal function Signed-off-by: Future-Outlier <[email protected]> * uncomment _serialize_flyte_type in dataclass transformer Signed-off-by: Future-Outlier <[email protected]> * use mashumaro SerializableType in flytefile, implemented _serialize and _deserialize methods Signed-off-by: Future-Outlier <[email protected]> * remove flytefile in serialize and deserialize function Signed-off-by: Future-Outlier <[email protected]> * support FlyteDirectory Signed-off-by: Future-Outlier <[email protected]> * uncomment self._serialize_flyte_type() in DataclassTransformer to_literal Signed-off-by: Future-Outlier <[email protected]> * lint Signed-off-by: Future-Outlier <[email protected]> * lint Signed-off-by: Future-Outlier <[email protected]> * remove a line Signed-off-by: Future-Outlier <[email protected]> * add print Signed-off-by: Future-Outlier <[email protected]> * uncomment deserialize in dataclass Signed-off-by: Future-Outlier <[email protected]> * remove dataclass json in the dataclass transformer Signed-off-by: Future-Outlier <[email protected]> * remove comments Signed-off-by: Future-Outlier <[email protected]> * remove prints Signed-off-by: Future-Outlier <[email protected]> * update notes Signed-off-by: Future-Outlier <[email protected]> * lint and fix test Signed-off-by: Future-Outlier <[email protected]> * Support structured dataset in dataclass Signed-off-by: Future-Outlier <[email protected]> * add back DataClassJsonMixin inheritance in test Signed-off-by: Future-Outlier <[email protected]> * add flytefile type hints Signed-off-by: Future-Outlier <[email protected]> * Improve type hints and use FlyteContextManager instead of FlyteContext Signed-off-by: Future-Outlier <[email protected]> * rename serialize flyte types to _convert_flyte_type_serializable and deserialize flyte types to _revert_to_flyte_type Signed-off-by: Future-Outlier <[email protected]> * Add comments to describe the dataclass transformer's lifecycle Signed-off-by: Future-Outlier <[email protected]> * rename using _make_flyte_type_serializable Signed-off-by: Future-Outlier <[email protected]> * Add logs to remind users to not use FlyteFile or FlyteDirectory in dataclass Signed-off-by: Future-Outlier <[email protected]> * Add unit tests in test_dataclass.py Signed-off-by: Future-Outlier <[email protected]> * Add Try Catch in dataclass transformer to literal Signed-off-by: Future-Outlier <[email protected]> * support default input Signed-off-by: Future-Outlier <[email protected]> * lint Signed-off-by: Future-Outlier <[email protected]> * generate random prefix for file and dir Signed-off-by: Future-Outlier <[email protected]> * upload successful tests Signed-off-by: Future-Outlier <[email protected]> * update flyteschema behaviour Signed-off-by: Future-Outlier <[email protected]> * add type hints Signed-off-by: Future-Outlier <[email protected]> * fix flyteschema tests Signed-off-by: Future-Outlier <[email protected]> * update tests Signed-off-by: Future-Outlier <[email protected]> * add coverage.xml in .gitignore Signed-off-by: Future-Outlier <[email protected]> * kevin's update Signed-off-by: Kevin Su <[email protected]> * add delattr(cls, "__class_getitem__") Signed-off-by: Future-Outlier <[email protected]> * use AttributeHider to change the behavior of hasattr(cls, __class_getitem__) for FlyteTypes Signed-off-by: Future-Outlier <[email protected]> * remove get_origin() Signed-off-by: Future-Outlier <[email protected]> * add back tests Signed-off-by: Future-Outlier <[email protected]> * Update pingsu's advice Signed-off-by: Future-Outlier <[email protected]> * test: create a variable for DCWithOptional Signed-off-by: Future-Outlier <[email protected]> * remove parent class from the AttributeHider Signed-off-by: Future-Outlier <[email protected]> --------- Signed-off-by: Future-Outlier <[email protected]> Signed-off-by: Kevin Su <[email protected]> Co-authored-by: Kevin Su <[email protected]> Signed-off-by: Jan Fiedler <[email protected]>
- Loading branch information
1 parent
af384c4
commit 14b1e38
Showing
13 changed files
with
1,120 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.