You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "farrukh-t (via GitHub)" <gi...@apache.org> on 2024/09/16 10:06:34 UTC
[I] TableauOperator fails to trigger Tableau Task [airflow]
farrukh-t opened a new issue, #42248:
URL: https://github.com/apache/airflow/issues/42248
### 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:
```txt
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](https://github.com/tableau/server-client-python/blob/257cf616f35cc36b24a73e9e102886a52ead1853/tableauserverclient/server/endpoint/tasks_endpoint.py#L72) a `task_item` argument of type `TaskItem` and `TableauOperator` [passes](https://github.com/apache/airflow/blob/a5d0a63d8784d7f4100a4770748c783261968e3c/airflow/providers/tableau/operators/tableau.py#L118) 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?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] TableauOperator fails to trigger Tableau Task [airflow]
Posted by "rawwar (via GitHub)" <gi...@apache.org>.
rawwar commented on issue #42248:
URL: https://github.com/apache/airflow/issues/42248#issuecomment-2570027634
@KS0107 , assigning this to you
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] TableauOperator fails to trigger Tableau Task [airflow]
Posted by "aarochuk (via GitHub)" <gi...@apache.org>.
aarochuk commented on issue #42248:
URL: https://github.com/apache/airflow/issues/42248#issuecomment-2728075571
I have been working on this and I think that this issue is that you are using resource="tasks" instead of resource="task" and I am not sure resource="tasks" is a valid resource. Are you sure you mean to use resource="tasks"? In addition @farrukh-t can you provide the full command you used to create the TableauOperator
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] TableauOperator fails to trigger Tableau Task [airflow]
Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal closed issue #42248: TableauOperator fails to trigger Tableau Task
URL: https://github.com/apache/airflow/issues/42248
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] TableauOperator fails to trigger Tableau Task [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #42248:
URL: https://github.com/apache/airflow/issues/42248#issuecomment-2352494823
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] TableauOperator fails to trigger Tableau Task [airflow]
Posted by "farrukh-t (via GitHub)" <gi...@apache.org>.
farrukh-t commented on issue #42248:
URL: https://github.com/apache/airflow/issues/42248#issuecomment-2730927692
> I have been working on this and I think that this issue is that you are using resource="tasks" instead of resource="task" and I am not sure resource="tasks" is a valid resource. Are you sure you mean to use resource="tasks"?
@aarochuk I'm pretty sure it should be `"tasks"`, not `"task"`. There is a dictionary `RESOURCE_METHODS` defined on [line 32](https://github.com/apache/airflow/blob/a5d0a63d8784d7f4100a4770748c783261968e3c/airflow/providers/tableau/operators/tableau.py#L32C1-L32C18):
<img width="367" alt="Image" src="https://github.com/user-attachments/assets/eec0f592-ed1c-4054-89d9-6fb327002036" />
Keys from this dictionary are used to validate the value of `resource` passed to `TableauOperator`:
<img width="842" alt="Image" src="https://github.com/user-attachments/assets/bc43519c-411a-4f18-8d78-fbd9988de247" />
If you do pass `resource="task"` instead, Airflow will raise an error:
```log
airflow.exceptions.AirflowException: Resource not found! Available Resources: dict_keys(['datasources', 'groups', 'projects', 'schedule', 'sites', 'subscriptions', 'tasks', 'users', 'workbooks'])
```
> In addition can you provide the full command you used to create the TableauOperator
Sure, this should be enough to reproduce the bug, just make sure you replace the placeholders with an actual task uuid and a Tableau connection id:
```python
from airflow import DAG
from airflow.providers.tableau.operators.tableau import TableauOperator
with DAG(dag_id="debug_tableau") as dag:
TableauOperator(
task_id="run_tableau_task",
resource="tasks",
method="run",
find="<replace_with_your_tableau_task_uuid>",
tableau_conn_id="<replace_with_your_tableau_connection_id>",
)
```
Failed task's logs:
```log
[2025-03-17, 20:41:20 UTC] {base.py:84} INFO - Using connection ID 'tableau_conn' for task execution.
[2025-03-17, 20:41:20 UTC] {server.py:246} INFO - versions: 3.21, 2.4
[2025-03-17, 20:41:20 UTC] {auth_endpoint.py:91} INFO - Signed into https://REDACTED/ as user with id REDACTED
[2025-03-17, 20:41:20 UTC] {auth_endpoint.py:115} INFO - Signed out
[2025-03-17, 20:41:20 UTC] {taskinstance.py:441} ▼ Post task execution logs
[2025-03-17, 20:41:20 UTC] {taskinstance.py:2890} ERROR - Task failed with exception
Traceback (most recent call last):
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/models/taskinstance.py", line 465, in _execute_task
result = _execute_callable(context=context, **execute_callable_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/models/taskinstance.py", line 432, in _execute_callable
return execute_callable(context=context, **execute_callable_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/models/baseoperator.py", line 400, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 274, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/tableauserverclient/server/endpoint/tasks_endpoint.py", line 134, in run
if not task_item.id:
^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'id'
[2025-03-17, 20:41:20 UTC] {taskinstance.py:1205} INFO - Marking task as FAILED. dag_id=debug_tableau, task_id=run_tableau_task, execution_date=20250317T204115, start_date=20250317T204119, end_date=20250317T204120
[2025-03-17, 20:41:20 UTC] {standard_task_runner.py:110} ERROR - Failed to execute job 3 for task run_tableau_task ('str' object has no attribute 'id'; 20498)
[2025-03-17, 20:41:20 UTC] {local_task_job_runner.py:240} INFO - Task exited with return code 1
[2025-03-17, 20:41:20 UTC] {taskinstance.py:3482} INFO - 0 downstream tasks scheduled from follow-on schedule check
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] TableauOperator fails to trigger Tableau Task [airflow]
Posted by "aarochuk (via GitHub)" <gi...@apache.org>.
aarochuk commented on issue #42248:
URL: https://github.com/apache/airflow/issues/42248#issuecomment-2707075692
Can I work on this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] TableauOperator fails to trigger Tableau Task [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #42248:
URL: https://github.com/apache/airflow/issues/42248#issuecomment-3986477886
@aarochuk We are unassigning you from this issue as part of our updated [assignment policy](https://github.com/apache/airflow/blob/main/contributing-docs/04_how_to_contribute.rst#contribute-code-changes).
This is not meant to discourage your contribution — quite the opposite! You are still very welcome to work on this issue and submit a PR for it. Simply comment that you are working on it and open a PR when ready.
We found that formal assignments were not working well, as they often prevented others from contributing when the assignee was not actively working on the issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org