cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Hyperleaup to push data to Tableau Server

kpendergast
Contributor

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.

1 ACCEPTED SOLUTION

Accepted Solutions

User16871418122
Contributor III

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...

View solution in original post

6 REPLIES 6

Anonymous
Not applicable

Hi again. Thank you for your question. Let's give it a bit longer to see what answers come.

Prabakar
Databricks Employee
Databricks Employee

Hi @Ken Pendergast​ could you please share the full stack trace?

@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.

User16871418122
Contributor III

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...

User16871418122
Contributor III

I created a git bug for a long term fix:

https://github.com/goodwillpunning/hyperleaup/issues/22

badnishant79
New Contributor II

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.

Connect with Databricks Users in Your Area

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