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

datadotworld API functions throwing errors that they do not exist #115

Closed
TheMitchWorksPro opened this issue Feb 10, 2020 · 2 comments
Closed

Comments

@TheMitchWorksPro
Copy link

client = dw.api_client
client.add_files_via_url('username/test-dataset', files={'sample.xls': {'url':'http://www.sample.com/sample.xls', 'description': 'sample doc', 'labels': ['raw data']}})

Worked my way through the entire list of test commands on your page up to this one. I had configured dw and had it working with other commands.

This one throws a python error that there is no such function/attribute of client.
I tried changing it to dw.api_client.add_files ...
Same problem

I also tried to test the create_dataset() function borrowing syntax from here:
https://ugoproto.github.io/ugo_py_doc/intro_to_data_world_in_python/#create-a-dataset-using-create_dataset-method

I get the same error about no such function as create_dataset()

My API key was obtained and configured ahead of trying things like this and you can also see cases where I succeeded and reading/writing to an existing dataset at:

studentoflife/dwapitesting

Not sure if there is something missing in the instructions, or something has gone wrong with the API functions code but hoping you guys might be able to give me an answer.

I am attempting to use all of this in an Anaconda/Jupyter notebook using Python 3.6 if that helps.

@brettandersonddw
Copy link

It looks like there was a small syntax error that's going to cause all the client methods to fail in that manner.

When creating a new api_client instance, make sure to use parentheses to call the constructor, e.g.:
client = dw.api_client() instead of client = dw.api_client

Then if you run type(client), you should see it return datadotworld.client.api.RestApiClient

@TheMitchWorksPro
Copy link
Author

Thanks! I will try that. Will they update the instructions so others don't run into the same issue? I just refreshed the page and the client line is still written without the (). Is there a separate place where documentation updates should be requested so they can be prioritized? ( I know you guys must be very busy).

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