<#219 [BUG] Do not re-register Flyte entities fetc...
# flyte-github
a
#219 [BUG] Do not re-register Flyte entities fetched from Admin Issue created by wild-endeavor Describe the bug If I register a task successfully with Admin, and then separately fetch the task, and then use it in another workflow, the task gets registered again. First declare and register
Copy code
@inputs(value_to_print=Types.Integer)
@python_task(cache_version='1', cache=False)
def print_int(wf_params, value_to_print):
    <http://wf_params.logging.info|wf_params.logging.info>("Value: {}".format(value_to_print))
Then in another file
Copy code
fetched_printer_task = _sdk_task.SdkTask.fetch('flytetester', 'development', 'app.workflows.sample_tasks.print_int',
                                               '0d5779f7eb093df23ec50212fe3a34dd238ed393')


@workflow_class
class TestTaskFetching(object):
    wf_input_to_print = Input(Types.Integer, default=5, help="Input for printer function")
    fetched_task_run = fetched_printer_task(value_to_print=wf_input_to_print)
After registering,
Copy code
$ flyte-cli -p flytetester -d development list-task-names | grep fetched
        cookbook.sample_workflows.formula_1.inner.fetched_printer_task
Expected behavior Flytekit should detect that this is a fetched task, and not reregister. The workflow should simply reference the original task in Admin. This reregistration also happens when fetched launch plans and workflows are detected. This change will need the dynamic node task node handler in propeller updated as well. Do not release the Flytekit change until the propeller change is done, otherwise certain dynamic tasks will break. Flyte component ☐ Overall ☐ Flyte Setup and Installation scripts ☐ Flyte Documentation ☐ Flyte communication (slack/email etc) ☑︎ FlytePropeller ☐ FlyteIDL (Flyte specification language) ☑︎ Flytekit (Python SDK) ☐ FlyteAdmin (Control Plane service) ☐ FlytePlugins ☐ DataCatalog ☐ FlyteStdlib (common libraries) ☐ FlyteConsole (UI) ☐ Other flyteorg/flyte