11-12-2021 03:28 PM
Would any care to share how they got the Hyperleaup library working I am currently stuck at an error at publish and cannot seem to find a solution.
TypeError: publish() got an unexpected keyword argument 'file_path'
I am %pip installing all the requirements and installing the library with:
%pip install git+https://github.com/goodwillpunning/hyperleaup
I create the query from a delta table with limit 10 so its small just to test and run:
hf = HyperFile(name="df_name", sql=query, is_dbfs_enabled=True, creation_mode='copy')
The file appears under in /tmp/hyperleaup/df_name/df_name.hyper
I set all the connection values and datasource_name an it authenticates. But the publish stops at the error I posted above. I am using my login credentials for tab server and have full admin privileges. I can display all datasources on our tableau server from a databricks notebook using other code to test the connection.
My Hyperleaup test notebook is running on cluster with runtime 10.1 using i3.xlarge if it matters. No custom config settings. If you need any other info please ask.
I've watched the data collab lab video on youtube. it would have been great to see the 5mins it took to config the demo.
11-23-2021 08:18 PM
There is nothing wrong with your code. There is a bug in line 107 of https://github.com/goodwillpunning/hyperleaup/blob/master/hyperleaup/publisher.py
The expected arg passing is filepath but it is defined as file_path.
You can edit the library in your local machine as below /local_disk0/.ephemeral_nfs/envs/pythonEnv-9ce478c3-3c92-4e39-8fb0-576418e91fb7/lib/python3.8/site-packages/hyperleaup/publisher.py to fix this.
datasource_item = server.datasources.publish(datasource_item=datasource_item,
filepath=self.hyper_file_path,
mode=create_mode)
Ref: line 190- argument acceptance syntax in dependant library: https://github.com/tableau/server-client-python/blob/master/tableauserverclient/server/endpoint/endp...
11-13-2021 11:55 AM
Hi again. Thank you for your question. Let's give it a bit longer to see what answers come.
11-15-2021 02:49 AM
Hi @Ken Pendergast could you please share the full stack trace?
11-15-2021 09:56 AM
@Prabakar Ammeappin Here is the full error from the last time I tried to run it:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<command-4104295034046338> in <module>
7
8 # Publish the Hyper File!
----> 9 luid = hf.publish(tableau_server_url=tableau_server,
10 username=username,
11 password=password,
/local_disk0/.ephemeral_nfs/envs/pythonEnv-9ce478c3-3c92-4e39-8fb0-576418e91fb7/lib/python3.8/site-packages/hyperleaup/hyper_file.py in publish(self, tableau_server_url, username, password, site_id, project_name, datasource_name)
72 publisher = Publisher(tableau_server_url, username, password,
73 site_id, project_name, datasource_name, self.path)
---> 74 self.luid = publisher.publish()
75 logging.info(f"Hyper File published to Tableau Server with datasource LUID : {self.luid}")
76
/local_disk0/.ephemeral_nfs/envs/pythonEnv-9ce478c3-3c92-4e39-8fb0-576418e91fb7/lib/python3.8/site-packages/hyperleaup/publisher.py in publish(self, creation_mode)
104 datasource_item = TSC.DatasourceItem(project_id=self.project_id, name=self.datasource_name)
105 logging.info(f'Publishing datasource: \n{datasource_to_string(datasource_item)}')
--> 106 datasource_item = server.datasources.publish(datasource_item=datasource_item,
107 file_path=self.hyper_file_path,
108 mode=create_mode)
/local_disk0/.ephemeral_nfs/envs/pythonEnv-9ce478c3-3c92-4e39-8fb0-576418e91fb7/lib/python3.8/site-packages/tableauserverclient/server/endpoint/endpoint.py in wrapper(self, *args, **kwargs)
161 def wrapper(self, *args, **kwargs):
162 self.parent_srv.assert_at_least_version(version)
--> 163 return func(self, *args, **kwargs)
164
165 return wrapper
/local_disk0/.ephemeral_nfs/envs/pythonEnv-9ce478c3-3c92-4e39-8fb0-576418e91fb7/lib/python3.8/site-packages/tableauserverclient/server/endpoint/endpoint.py in wrapper(self, *args, **kwargs)
203 error = "{!r} not available in {}, it will be ignored. Added in {}".format(p, server_ver, min_ver)
204 warnings.warn(error)
--> 205 return func(self, *args, **kwargs)
206
207 return wrapper
/local_disk0/.ephemeral_nfs/envs/pythonEnv-9ce478c3-3c92-4e39-8fb0-576418e91fb7/lib/python3.8/site-packages/tableauserverclient/server/endpoint/endpoint.py in wrapper(self, *args, **kwargs)
203 error = "{!r} not available in {}, it will be ignored. Added in {}".format(p, server_ver, min_ver)
204 warnings.warn(error)
--> 205 return func(self, *args, **kwargs)
206
207 return wrapper
TypeError: publish() got an unexpected keyword argument 'file_path'
If you would like me to rerun it for logs please let me know.
11-23-2021 08:18 PM
There is nothing wrong with your code. There is a bug in line 107 of https://github.com/goodwillpunning/hyperleaup/blob/master/hyperleaup/publisher.py
The expected arg passing is filepath but it is defined as file_path.
You can edit the library in your local machine as below /local_disk0/.ephemeral_nfs/envs/pythonEnv-9ce478c3-3c92-4e39-8fb0-576418e91fb7/lib/python3.8/site-packages/hyperleaup/publisher.py to fix this.
datasource_item = server.datasources.publish(datasource_item=datasource_item,
filepath=self.hyper_file_path,
mode=create_mode)
Ref: line 190- argument acceptance syntax in dependant library: https://github.com/tableau/server-client-python/blob/master/tableauserverclient/server/endpoint/endp...
11-23-2021 08:22 PM
I created a git bug for a long term fix:
09-28-2022 02:07 AM
Hi. Yes dashboard includes multiple filters but only uploaded dashboard on server without any other sheets. I am looking into the extract that other users have suggested. Thanks.
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group