datadotworld / data.world-py

Python package for data.world
https://data.world/integrations/python
Apache License 2.0
102 stars 28 forks source link

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

Closed TheMitchWorksPro closed 4 years ago

TheMitchWorksPro commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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