Skip to content

Conversation

@farrukh-t
Copy link

closes: #42248

This pull request fixes the bug in TableauOperator where the operator was calling tableau_hook.server.tasks.run(...) method and passing in the Tableau Task ID string (the resource_id variable), while the method expects a tableauserverclient.models.TaskItem object instead:

https://github.com/tableau/server-client-python/blob/development/tableauserverclient/server/endpoint/tasks_endpoint.py#L119

For a more detailed description of the bug, please refer to #42248


@boring-cyborg
Copy link

boring-cyborg bot commented Nov 1, 2025

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

@farrukh-t farrukh-t force-pushed the bugfix/42248-fix-tableau-operator-run-task branch from f686ec0 to 3e6e9dd Compare November 1, 2025 22:27
@farrukh-t farrukh-t force-pushed the bugfix/42248-fix-tableau-operator-run-task branch from 3e6e9dd to a348c24 Compare November 2, 2025 12:50
check_interval=self.check_interval,
target_state=TableauJobFinishCode.SUCCESS,
):
raise TableauJobFailedException(f"The Tableau Refresh {self.resource} Job failed!")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe logging the job ID would make it easier for debugging.

Comment on lines +122 to +125
if self.resource == "tasks" and self.method == "run":
task_item = resource.get_by_id(resource_id)
response = method(task_item)
job_item = JobItem.from_response(response, tableau_hook.server.namespace)[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from_response(...)[0] assumes a non-empty list. If the API returns an empty collection, we would get an IndexError. It would be good to guard with if response or raise a clearer AirflowException when empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TableauOperator fails to trigger Tableau Task

2 participants