Hi ! I am trying to use reference_task with map_t...
# ask-the-community
n
Hi ! I am trying to use reference_task with map_task as its not supported with dynamic . but i get this error: map_task error:
Copy code
Failed with Unknown Exception <class 'AttributeError'> Reason: Error encountered while executing 'wf':
  'ReferenceTask' object has no attribute '_task_function'
dynamic error
Copy code
[3/3] currentAttempt done. Last Error: SYSTEM::Traceback (most recent call last):

      File "/opt/venv/lib/python3.9/site-packages/flytekit/exceptions/scopes.py", line 165, in system_entry_point
        return wrapped(*args, **kwargs)
      File "/opt/venv/lib/python3.9/site-packages/flytekit/core/base_task.py", line 539, in dispatch_execute
        raise e
      File "/opt/venv/lib/python3.9/site-packages/flytekit/core/base_task.py", line 536, in dispatch_execute
        native_outputs = self.execute(**native_inputs)
      File "/opt/venv/lib/python3.9/site-packages/flytekit/core/python_function_task.py", line 166, in execute
        return self.dynamic_execute(self._task_function, **kwargs)
      File "/opt/venv/lib/python3.9/site-packages/flytekit/core/python_function_task.py", line 301, in dynamic_execute
        return self.compile_into_workflow(ctx, task_function, **kwargs)
      File "/opt/venv/lib/python3.9/site-packages/flytekit/core/python_function_task.py", line 227, in compile_into_workflow
        raise Exception("Reference tasks are currently unsupported within dynamic tasks")

Message:

    Reference tasks are currently unsupported within dynamic tasks

SYSTEM ERROR! Contact platform administrators.
Flytekit 1.7.0 is it not supported ?
s
You should be able to reference map tasks. Is this something we need to support? @Eduardo Apolinario (eapolinario) @Kevin Su
n
any answers?
k
we don’t support reference task in the dynamic for now, because flytekit needs credentials (client id and secret) to connect to the flyteadmin. However, when you running the task in the pod, there is no credentials.
n
Thanks! Any idea why it also fails to run reference task in a map task ?
Copy code
Failed with Unknown Exception <class 'AttributeError'> Reason: Error encountered while executing 'wf':
  'ReferenceTask' object has no attribute '_task_function
k
you want to map over reference task? it’s also not supported right now. https://github.com/flyteorg/flyte/issues/3573