apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
37.12k stars 14.31k forks source link

TableauOperator fails to trigger Tableau Task #42248

Open farrukh-t opened 2 months ago

farrukh-t commented 2 months ago

Apache Airflow Provider(s)

tableau

Versions of Apache Airflow Providers

apache-airflow-providers-tableau==4.5.0

Apache Airflow version

v2.9.0

Operating System

ubuntu

Deployment

Docker-Compose

Deployment details

No response

What happened

TableauOperator fails with resource="tasks" and method="run" arguments with the following traceback:

  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/tableau/operators/tableau.py", line 118, in execute
    response = method(resource_id)
               ^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/tableauserverclient/server/endpoint/endpoint.py", line 258, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/tableauserverclient/server/endpoint/tasks_endpoint.py", line 73, in run
    if not task_item.id:
           ^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'id'

What you think should happen instead

I believe the issue is that Tasks.run method expects a task_item argument of type TaskItem and TableauOperator passes the task's id as a str instead.

How to reproduce

Execute TableauOperator with resource="tasks" and method="run" arguments

Anything else

No response

Are you willing to submit PR?

Code of Conduct

boring-cyborg[bot] commented 2 months ago

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.