Skip to content

Commit

Permalink
Use Pure Dataclass In Example (#1747)
Browse files Browse the repository at this point in the history
Signed-off-by: Future-Outlier <[email protected]>
  • Loading branch information
Future-Outlier authored Oct 9, 2024
1 parent 846ad8b commit 3778c44
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/data_types_and_io/data_types_and_io/dataclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from flytekit.types.directory import FlyteDirectory
from flytekit.types.file import FlyteFile
from flytekit.types.structured import StructuredDataset
from mashumaro.mixins.json import DataClassJSONMixin

# NOTE: If you're using Flytekit version below v1.10, you'll need to decorate with `@dataclass_json` using
# `from dataclass_json import dataclass_json` instead of inheriting from Mashumaro's `DataClassJSONMixin`.
Expand All @@ -23,7 +22,7 @@
# Python types
# Define a `dataclass` with `int`, `str` and `dict` as the data types
@dataclass
class Datum(DataClassJSONMixin):
class Datum:
x: int
y: str
z: dict[int, str]
Expand All @@ -50,7 +49,7 @@ def add(x: Datum, y: Datum) -> Datum:

# Flyte types
@dataclass
class FlyteTypes(DataClassJSONMixin):
class FlyteTypes:
dataframe: StructuredDataset
file: FlyteFile
directory: FlyteDirectory
Expand Down

0 comments on commit 3778c44

Please sign in to comment.