https://flyte.org logo
#ask-the-community
Title
# ask-the-community
f

Frank Shen

10/21/2022, 9:52 PM
Hello, I have a workflow that requires a custom client connection (Feathr client). I need to get the client and pass it to the subsequent tasks. E.g.
Copy code
from feathr_client_wrapper.feathr_client import generate_feathr_client
from feathr.client import FeathrClient


# @task
def get_feathr_client() -> FeathrClient:
    client = generate_feathr_client(
        team="customer",
        environment="dev",
        organization="wm",
        cluster_size="small",
        project_name="test_project",
        email="<mailto:test@warnermedia.com|test@warnermedia.com>",
        aws_registry=True
    )
    return client

@task
def list_features(client: FeathrClient, project_name: str) -> typing.List:
    return client.list_registered_features(project_name=project_name)

@workflow
def wf(project_name: str = 'feathr_demo') -> typing.List:
    client = get_feathr_client()
    return list_features(client = client, project_name = project_name)

if __name__ == "__main__":
    print(wf())
77 Views