-
-
Save pingsutw/cd3e53905aba6b2073b11ad72c900b14 to your computer and use it in GitHub Desktop.
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
from flytekit import task, StructuredDataset, workflow | |
import pandas as pd | |
import pyarrow as pa | |
df = pd.DataFrame({"Name": ["Tom", "Joseph"], "Age": [1, 22], "Height": [160, 178]}) | |
padf = pa.Table.from_pandas(pd.DataFrame({"Name": ["Tom", "Joseph"], "Age": [20, 22]})) | |
@task | |
def t1() -> StructuredDataset: | |
return StructuredDataset(dataframe=padf, uri="gs://flyte-private/") | |
@task | |
def t2(sd: StructuredDataset): | |
print(sd.open(pa.Table).all()) | |
@workflow | |
def wf(): | |
t2(sd=t1()) | |
wf() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment