Extending Tableau with Ople.ai and new functions

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:

Do you know of any other examples worth sharing?

TabPy v1 released!

It took some time, but TabPy v1 finally happened. Comparing to the previous v0.9.0 there are not so many changes:

To install TabPy or update your TabPy instance to the latest release run the following command:

pip install --upgrade tabpy

Additional reading:

Haskell in Tableau? Yes, you can!

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?

Yes – it is possible and people actually do it. Here’s an example of how you can use Haskell scripts in Tableau calculations – https://databoss.starschema.net/tableau-external-services-api-adding-haskell-calculations/. The post explains step by step how to implement TabPy API in Haskell and how to use the server with Tableau. Very well written post indeed and highly recommended for reading. The project itself is available on GitHub – https://github.com/tfoldi/tc19-haskell-ext/.

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 – lightweight and straightforward alternative to TabPy

Do you want to add some Python scripting to your Tableau visualization but struggle with How to Configure TabPy documentation? Take a look at AltTabPy – https://alttabpy.readthedocs.io/en/latest/index.html.

What TabPy is – Python script execution engine you can connect Tableau in the same way as you do for TabPy. Its installation and startup are extremely straightforward and simple, more details here – https://alttabpy.readthedocs.io/en/latest/getting_started.html#installing.

What TabPy is not – it does not support models (deployed functions), authentication, SSL, logging and other configuration and backward compatibility with older TabPy versions. Read here for more details on how AtlTabPy is different – https://alttabpy.readthedocs.io/en/latest/comparison.html.

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: how do I know what models are available?


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.