How to avoid intermittent authentication errors with Tableau API and streamlit?


I just discovered and I am developing a Web UI using it and the Tableau API.

Python functions, which use the Tableau API, work fine. Unit tests were performed with Pytest adn the expected results are observed. However, when I use these functions with streamlit, I get intermittent authentication errors (401002: Unauthorized Access. Invalid authentication credentials were provided).

Doing a test, I use a function and it works fine, but when I try to use another functionaly I get authentication errors. Then, I exit the app and use the same functionality, and there is no problem. This is what I mean by flashing intermittence.

Thanks in advance for your help and suggestions!


— Miguel

Hey @maoroshdez,

Thanks for sharing this question! Is it possible that the Tableau API you’re using is expecting you to allow-list the IP addresses from which you’re making the calls to the API? Alternatively, do you know if there’s a rate limit on the API?

Thanks a lot!

I had to optimize the connections to the Tableau API. I was losing this connection and I created a new one every time.

Thank you for your advise! It is very useful!


— Miguel-Angel

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.