# ask-the-community

Cornelis Boon

03/11/2024, 12:07 PM
Hey, got a little trouble when trying to register my workflow to my remote flyte instance using
Copy code
pyflyte register workflows/
By the looks of it, it happens when it tries to generate a default launchplan, but I'm not sure how to fix it or how to reproduce it outside of registration Stacktrace in ๐Ÿงต
Copy code
Failed with Unknown Exception <class 'TypeError'> Reason: isinstance() arg 2 must be a type, a tuple of types, or a union
  File "<<root>>/envs/flyte/lib/python3.10/site-packages/flytekit/clis/sdk_in_container/", line 139, in invoke
    return super().invoke(ctx)

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/click/", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/click/", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/click/", line 783, in invoke
    return __callback(*args, **kwargs)

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/click/", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/flytekit/clis/sdk_in_container/", line 202, in register
    raise e

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/flytekit/clis/sdk_in_container/", line 183, in register

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/flytekit/tools/", line 264, in register
    registrable_entities = load_packages_and_modules(

  File "<<root>>envs/flyte/lib/python3.10/site-packages/flytekit/tools/", line 183, in load_packages_and_modules
    registrable_entities = serialize(pkgs_and_modules, ss, str(project_root), options)

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/flytekit/tools/", line 48, in serialize
    registrable_entities = get_registrable_entities(ctx, options=options)

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/flytekit/tools/", line 60, in get_registrable_entities
    lp = LaunchPlan.get_default_launch_plan(ctx, entity)

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/flytekit/core/", line 93, in get_default_launch_plan
    parameter_map = transform_inputs_to_parameters(ctx, workflow.python_interface)

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/flytekit/core/", line 233, in transform_inputs_to_parameters
    default_lv = TypeEngine.to_literal(ctx, _default, python_type=interface.inputs[k], expected=v.type)

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/flytekit/core/", line 1111, in to_literal
    transformer.assert_type(python_type, python_val)

  File "<<root>>/envs/flyte/lib/python3.10/site-packages/flytekit/core/", line 154, in assert_type
    if not hasattr(t, "__origin__") and not isinstance(v, t):

isinstance() arg 2 must be a type, a tuple of types, or a union
One type annotation had a '=" instead of ':' ๐Ÿ˜…

Kevin Su

03/11/2024, 6:13 PM
could you share your code snippet?

Cornelis Boon

03/11/2024, 6:21 PM
I can't post specifically my code due to confidentiality reasons, but it looked similar to:
Copy code
from flytekit import workflow

def mywf(first=str, second=str):
instead of
Copy code
from flytekit import workflow

def mywf(first:str, second:str):
Swapping the equal signs for colons was all I needed to do
Just wasnt' immediately clear from the stacktrace

Kevin Su

03/11/2024, 6:33 PM
ah, I see. could you file a ticket? [flyte-bug]

Kevin Su

03/11/2024, 6:34 PM
weโ€™re trying to improve the error message recently