Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: publish() got an unexpected keyword argument 'file_path' #22

Open
gobiviswanath opened this issue Nov 24, 2021 · 2 comments
Open

Comments

@gobiviswanath
Copy link

https://community.databricks.com/s/question/0D53f00001Tgle2CAB/hyperleaup-to-push-data-to-tableau-server

` ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in
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'`
@gobiviswanath
Copy link
Author

gobiviswanath commented Nov 24, 2021

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.

                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/endpoint.py

@harrywatts125
Copy link
Contributor

This should be addressed in my pull request made today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants