Closed ElPincheTopo closed 4 years ago
I've had the same issue. An option that works for me is to create a template Tableau file with a generic query/table and then alter it using Python. Documented here.
tableaukun's solution is the better one. The "create_extract" stuff proved to be more problematic than it was worth, and it included dependencies on the Extract APIs which cannot be installed as regular requirements.
In the new 5.X release, the "create_extract" method has been deprecated, but all the manipulation methods remain if you need to change data source connection info or even the filters on the extract (after it has been created in Desktop in a template file).
I know this has been asked before in different ways but the previous issues don't really solve my issue. I have a python project that does my ETL process and sets up postgres tables that Tableau can use. After we create each table we have to manually go into Tableau Desktop and create a new data source that points to the new table set the data source to be an extract and the publish it to Tableau Server where we schedule the refreshes. I'm trying to automate the process of manually creating the data sources on Tableau desktop and then publish them to the server.
Following the docs and looking at the code I was able to do this:
And it successfully creates a live connection to my table on my database. Now I want to be able to create a datasource that is an extract and that can be refreshed on a schedule on the server. I tried adding this
create_extract(extract_name)
just before saving the file, but it fails on save file with the following error:I'm not sure if I'm doing something wrong or if what I want to do is not supported by the library. Could you help me out with this?