In my previous post Haskell in Tableau? Yes, you can! I mentioned an example of Analytics Extention API implementation in the way it allowed to use Haskell in Tableau calculations.
And there are more examples of how Tableau calculations can be extended:
Some time ago I posted about alternative TabPy implementation (AltTabPy – lightweight and straightforward alternative to TabPy) you can use with Tableau. Using that alternative solution is possible because AltTabPy implements TabPy API and Tableau Desktop or Server simply calls that API. So Tableau is not hardcoded to use TabPy.
But if alternative implementations are possible is it also possible to implement the API for something completely different than executing Python script… like another programming language?
With those two examples (and there are few more you can find) it should be possible to implement TabPy API for any programming language (Lua, SQL, JavaScript, etc.) or even a service (imagine receiving weather data for given coordinates and date/time).
AltTabPy is not supported by Tableau and is an independent project which (partially) implements TabPy API v1. The project itself is located on GitHub – https://github.com/innobi/AltTabPy.
TabPy allows deploying functions that can be called from Tableau side (more technical details are at Using Deployed Functions documentation page). With that feature, you may create a repository of models (this is what I call deployed functions in this post) with many entries with time. And at some moment the question of getting the list of all available models arises.
There are at least 3 ways to find out what models are available for a specific instance of TabPy. Let’s look at them.
Option 0. Index Page (updated Feb 02, 2020)
With TabPy v0.9.0 release you can just open your TabPy instance host:port in a browser and deployed models together with some other data will be displayed on the page.
Option 1. TabPy Logs
TabPy outputs some logging data in the console and the same log entries are preserved in a log file. The lines you are looking for have “Load endpoint: ” with a model name following it (endpoint here is just another name for a deployed function). In the screenshot below you can see models PCA, Sentiment Analysis, ttest, add, and anova being loaded on TabPy startup and available for being used in Tableau calculations.
Option 2. TabPy State File
On TabPy startup, it informs in the log output about state file location (example in the screenshot below). State file is used by Tornado web-server which TabPy is built around.
The log entry shows the location for the state file. In the file itself, there is [Query Objects Service Versions] section which lists all the deployed models. As you can see the same models you can find in TabPy logs are listed in the section.
Option 3. Use the API, Luke
In the Invoking TabPy API with Postman post, I explained how to use Postman to call TabPy API. And using the API is the best way for this scenario as well – implementation may (and will) change in the future (what is logged, how and where, how functions are deployed and preserved, where the state is preserved and so on) but the API hides all those details.
As documented for /endpoints method it returns a list of all deployed models. And Postman file in TabPy repo has the method in the collection. Simply use that method (specify your TabPy address) and you’ll see something like this:
Returned JSON lists all the deployed models and their properties.