miniature-traffic-86643
07/03/2024, 11:47 AMimport pandas as pd
from sklearn.datasets import load_wine
from flytekit import task, workflow
from flytekit.configuration import ImageConfig, Config
from flytekit.types.pickle import FlytePickle
from flytekit.remote import FlyteRemote
# 🧱 @task decorators define the building blocks of your pipeline
@task
def get_data() -> pd.DataFrame:
"""Get the wine dataset."""
return load_wine(as_frame=True).frame
# 🔀 @workflows decorators define the flow of data through the tasks
@workflow
def training_workflow(x:int) -> pd.DataFrame:
"""Put all of the steps together into a single workflow."""
data = get_data()
return data
# FlyteRemote object is the main entrypoint to API
remote = FlyteRemote(
config=Config.auto(),
default_project="flytesnacks",
default_domain="development",
)
remote.execute(
training_workflow,
inputs={'x':0},
image_config=ImageConfig.auto_default_image(),
version="v2"
)
freezing-airport-6809
miniature-traffic-86643
07/03/2024, 2:44 PMtall-lock-23197
miniature-traffic-86643
07/04/2024, 9:18 AMminiature-traffic-86643
07/04/2024, 9:19 AMtall-lock-23197
miniature-traffic-86643
07/04/2024, 10:37 AMremote.fast_package
deprecated?miniature-traffic-86643
07/04/2024, 11:00 AMminiature-traffic-86643
07/04/2024, 11:00 AMtall-lock-23197
register_script
should work. have you tried register_workflow
instead? it has a better interface than register_script
. the example i've shared registers using the register_workflow
method.tall-lock-23197
fast_package
isn't deprecated. register_script
uses fast_package
under the hood.miniature-traffic-86643
07/04/2024, 11:32 AMminiature-traffic-86643
07/04/2024, 11:56 AMtall-lock-23197
miniature-traffic-86643
07/04/2024, 12:08 PMpip install -U flytekit
freezing-airport-6809
freezing-airport-6809