-
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.
Fix Flyte Types Upload Issues in Default Input (#2907)
* Fix Flyte Types Upload Issues in Default Input Signed-off-by: Future-Outlier <[email protected]> * TODO: ADD SD CASES, and flyteschema cases and run it in remote Signed-off-by: Future-Outlier <[email protected]> * nit Signed-off-by: Future-Outlier <[email protected]> * nit Signed-off-by: Future-Outlier <[email protected]> * update Signed-off-by: Future-Outlier <[email protected]> * update Signed-off-by: Future-Outlier <[email protected]> * update kevin's advice Signed-off-by: Future-Outlier <[email protected]> Co-authored-by: pingsutw <[email protected]> * lint Signed-off-by: Future-Outlier <[email protected]> * lint Signed-off-by: Future-Outlier <[email protected]> * add test_flytetypes Signed-off-by: Future-Outlier <[email protected]> * better-api Signed-off-by: Future-Outlier <[email protected]> --------- Signed-off-by: Future-Outlier <[email protected]> Co-authored-by: pingsutw <[email protected]>
- Loading branch information
1 parent
d4171c3
commit 8fdd0c6
Showing
8 changed files
with
146 additions
and
11 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
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
Binary file added
BIN
+2.16 KB
tests/flytekit/integration/remote/workflows/basic/data/df.parquet/00000
Binary file not shown.
48 changes: 48 additions & 0 deletions
48
tests/flytekit/integration/remote/workflows/basic/generic_idl_flytetypes.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import typing | ||
import os | ||
from dataclasses import dataclass, fields, field | ||
from typing import Dict, List | ||
from flytekit.types.file import FlyteFile | ||
from flytekit.types.structured import StructuredDataset | ||
from flytekit.types.directory import FlyteDirectory | ||
from flytekit import task, workflow, ImageSpec | ||
import datetime | ||
from enum import Enum | ||
import pandas as pd | ||
|
||
@dataclass | ||
class DC: | ||
ff: FlyteFile | ||
sd: StructuredDataset | ||
fd: FlyteDirectory | ||
|
||
|
||
@task | ||
def t1(dc: DC = DC(ff=FlyteFile(os.path.realpath(__file__)), | ||
sd=StructuredDataset( | ||
uri="tests/flytekit/integration/remote/workflows/basic/data/df.parquet", | ||
file_format="parquet"), | ||
fd=FlyteDirectory("tests/flytekit/integration/remote/workflows/basic/data/") | ||
)): | ||
|
||
with open(dc.ff, "r") as f: | ||
print("File Content: ", f.read()) | ||
|
||
print("sd:", dc.sd.open(pd.DataFrame).all()) | ||
|
||
df_path = os.path.join(dc.fd.path, "df.parquet") | ||
print("fd: ", os.path.isdir(df_path)) | ||
|
||
return dc | ||
|
||
@workflow | ||
def wf(dc: DC = DC(ff=FlyteFile(os.path.realpath(__file__)), | ||
sd=StructuredDataset( | ||
uri="tests/flytekit/integration/remote/workflows/basic/data/df.parquet", | ||
file_format="parquet"), | ||
fd=FlyteDirectory("tests/flytekit/integration/remote/workflows/basic/data/") | ||
)): | ||
t1(dc=dc) | ||
|
||
if __name__ == "__main__": | ||
wf() |
48 changes: 48 additions & 0 deletions
48
tests/flytekit/integration/remote/workflows/basic/msgpack_idl_flytetypes.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import typing | ||
import os | ||
from dataclasses import dataclass, fields, field | ||
from typing import Dict, List | ||
from flytekit.types.file import FlyteFile | ||
from flytekit.types.structured import StructuredDataset | ||
from flytekit.types.directory import FlyteDirectory | ||
from flytekit import task, workflow, ImageSpec | ||
import datetime | ||
from enum import Enum | ||
import pandas as pd | ||
|
||
@dataclass | ||
class DC: | ||
ff: FlyteFile | ||
sd: StructuredDataset | ||
fd: FlyteDirectory | ||
|
||
|
||
@task | ||
def t1(dc: DC = DC(ff=FlyteFile(os.path.realpath(__file__)), | ||
sd=StructuredDataset( | ||
uri="tests/flytekit/integration/remote/workflows/basic/data/df.parquet", | ||
file_format="parquet"), | ||
fd=FlyteDirectory("tests/flytekit/integration/remote/workflows/basic/data/") | ||
)): | ||
|
||
with open(dc.ff, "r") as f: | ||
print("File Content: ", f.read()) | ||
|
||
print("sd:", dc.sd.open(pd.DataFrame).all()) | ||
|
||
df_path = os.path.join(dc.fd.path, "df.parquet") | ||
print("fd: ", os.path.isdir(df_path)) | ||
|
||
return dc | ||
|
||
@workflow | ||
def wf(dc: DC = DC(ff=FlyteFile(os.path.realpath(__file__)), | ||
sd=StructuredDataset( | ||
uri="tests/flytekit/integration/remote/workflows/basic/data/df.parquet", | ||
file_format="parquet"), | ||
fd=FlyteDirectory("tests/flytekit/integration/remote/workflows/basic/data/") | ||
)): | ||
t1(dc=dc) | ||
|
||
if __name__ == "__main__": | ||
wf() |