Closed jaybythebay closed 4 months ago
@JustinGrilli this is ready for review. I tested all functionality in the cli and it works like a charm! Replacing the functions in Airflow and setting the new import should be really really easy.
If you're willing to merge this without testing Airflow that would be great. I have a couple of things to do before I can get Airflow working with extracts and all that stuff. If I'm a total insomniac this weekend then I'll try to get to it otherwise it'll be later this week.
Background
This is a fix for https://github.com/hoverinc/tableau-utilities/issues/75. On newer apple computers installation fails because tableauhyperapi is not compatible with Apple Silicon machines: https://tableau.github.io/hyper-db/docs/installation#hardware-requirements
This PR:
max_varchar_size
to Connection object. This appears in a Snowflake extract with Tableau 2024.1Testing
Installation
pip install ./
this installed the tableau_utilities but did not install the tableauhyperapi dependencypip install ./[hyper]
this DID install the tableauhyperapi dependencyCLI Commands
cli throws error when package is not installed
-ee flag
tableau_utilities --token_name $TABLEAU_PAT_NAME --token_secret $TABLEAU_PAT_VALUE --site $TABLEAU_SITE_NAME --server $TABLEAU_SERVER --location online --name call_center --project_name 'default' -f Datasource.tdsx datasource -ee
-fe flag
tableau_utilities --token_name $TABLEAU_PAT_NAME --token_secret $TABLEAU_PAT_VALUE --site $TABLEAU_SITE_NAME --server $TABLEAU_SERVER --location online --name call_center --project_name 'default' -f Datasource.tdsx datasource -fe 'Cc Class = medium'
Testing Functions WITH sub-page installed
Download empty extract
Publish Empty Extract
tableau_utilities --token_name $TABLEAU_PAT_NAME --token_secret $TABLEAU_PAT_VALUE --site $TABLEAU_SITE_NAME --server $TABLEAU_SERVER --name call_center --project_name 'default' -f '/Users/jayrosenthal/code/tableau-utilities/tmp_tdsx_and_config/call_center.tdsx' server_operate --publish datasource PUBLISHING DATASOURCE → ID: cda42c94-d287-4ab2-9935-225ceb3a7d6a ║ NAME: call_center ║ PROJECT NAME: default ✅ default / call_center:
Workbook can be created but the data is empty
Download with Filter
tableau_utilities --token_name $TABLEAU_PAT_NAME --token_secret $TABLEAU_PAT_VALUE --site $TABLEAU_SITE_NAME --server $TABLEAU_SERVER --location online --name call_center --project_name 'default' -f Datasource.tdsx --include_extract datasource -fe "\"CC_REC_START_DATE\" < '1/1/2001'" ...Downloading call_center... ✅ (Done in 1 sec) Downloaded Datasource: /Users/jayrosenthal/code/tableau-utilities/tmp_tdsx_and_config/call_center.tdsx
...Filtering extract data... ✅ (Done in 0 sec) Filtered extract data for /Users/jayrosenthal/code/tableau-utilities/tmp_tdsx_and_config/call_center.tdsx (venv) jaysmacbookhome:tableau-utilities jayrosenthal$
Publish filtered datasets
tableau_utilities --token_name $TABLEAU_PAT_NAME --token_secret $TABLEAU_PAT_VALUE --site $TABLEAU_SITE_NAME --server $TABLEAU_SERVER --name call_center --project_name 'default' -f '/Users/jayrosenthal/code/tableau-utilities/tmp_tdsx_and_config/call_center.tdsx' server_operate --publish datasource PUBLISHING DATASOURCE → ID: cda42c94-d287-4ab2-9935-225ceb3a7d6a ║ NAME: call_center ║ PROJECT NAME: default ✅ default / call_center:
Pre-filtered set has data in 1998 and 2000
Publish after filter on has data in 2001 and 2002