<#2215 [Core feature] [flytekit] Add code to be ab...
# flytekit
a
#2215 [Core feature] [flytekit] Add code to be able to mock fetched Flyte entities Issue created by wild-endeavor Motivation: Why do you think this is important? Be able to mock out fetched Flyte entities in the flytekit interactive experience. After #867 is merged, users will be able to do something like this
Copy code
from flytekit.remote.remote import FlyteRemote
# Constructor to FlyteRemote will be changing shortly
remote = FlyteRemote.from_config("flytesnacks", "development", config_file_path="/Users/user/.flyte/prod_basic")
fetched_task = remote.fetch_task(name="core.flyte_basics.my_task", version="v0.3.39")

@workflow
def wf(a: int) -> int:
    return fetched_task(a=a).with_overrides(node_name="my-fetched-task-node")
However,
wf
will not be locally runnable. If you try to
wf(a=5)
, you'll get an exception saying that fetched entities are not callable. However users should be able to provide a local Python function with a matching interface to mock out the fetched entity. Goal: What should the final outcome look like, ideally? Not sure... need to give this some more thought. Describe alternatives you've considered None. Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte