Repository navigation
Support Personal access token method for Tableau Connection - #34927
baruch-shteken wants to merge 4 commits into
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 Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
|
Hey @baruch-shteken , thanks for posting a PR for this issue. From my understanding, if a job try to authenticate using the same PAT as a concurrent job, the former job will fail. Am I missing something ? |
|
Thanks @Michae94 for your question. From the above, I drew the conclusion that if we authenticate every-time to Tableau for every call, the process should work. That being said, I didn't test it end2end. Should I test it with my private Tableau data sources? Can I create a test for it here? |
|
Hey @baruch-shteken , thanks for the answer. Let's say we have 2 concurrent tasks, completely isolated (not run on the same machine). Both of them will use the same PAT to authenticate.
Maybe there is something I missed 🤔 |
|
@Michae94 |
|
Ok now I understand better your proposition. |
|
I don't know how Airflow kubernetes workers work but if they all use the code I propose here and even with the same PAT, it should still be ok. Because each task will authenticate again before sending a request to Tableau. |
If this is true then it will never really work regardless of the underlying archetacture (Celery, Kubernetes, etc..) The question that needs to be answered is how Tableau recommands to do authentication from two seperated proccesses that tries to refresh two different dashboards at the same time. |
|
I tested my changes locally (I didn't manage to pull my changes from GitHub. However, we use an Airflow docker so I changed the file @Michae94 Is the concurrency problem what you meant before in Kubernetes? Do you have any recommendation for me on how to improve the process? Can I configure somewhere in the Airflow code that only 1 Tableau hook object can be active at any moment? |
You can not. This can only be enforced from users side if they create pool for tableau and don't allow more than 1 tableau task to run at the same time.
Sure. From Airflow point of view - we only can enable capabilities of Tableau SDK so if the SDK is missing a feature that should be a feature request to Tableau. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
closes: #25904
I read the Tableau Python SDK docs and I didn't see any meaningful feature that can help solving this problem.
I decided that what I can do changing the connection setting in the Tableau hook.
Instead of generating the connection 1 time when the hook is initialized (enter function), I would like the tableau connection to be set before any API request to Tableau. This should solve the problem because the Tableau session_token will be newly generated before every call.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.