-
Notifications
You must be signed in to change notification settings - Fork 15.9k
fix tableau operator run tasks execution #57704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix tableau operator run tasks execution #57704
Conversation
|
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)
|
f686ec0 to
3e6e9dd
Compare
3e6e9dd to
a348c24
Compare
| check_interval=self.check_interval, | ||
| target_state=TableauJobFinishCode.SUCCESS, | ||
| ): | ||
| raise TableauJobFailedException(f"The Tableau Refresh {self.resource} Job failed!") |
There was a problem hiding this comment.
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.
| 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] |
There was a problem hiding this comment.
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.
closes: #42248
This pull request fixes the bug in
TableauOperatorwhere the operator was callingtableau_hook.server.tasks.run(...)method and passing in the Tableau Task ID string (theresource_idvariable), while the method expects atableauserverclient.models.TaskItemobject 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