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

KeyError:'dataSet' from ds_create #80

Open
mvscarmack opened this issue Aug 19, 2022 · 1 comment
Open

KeyError:'dataSet' from ds_create #80

mvscarmack opened this issue Aug 19, 2022 · 1 comment

Comments

@mvscarmack
Copy link

I am running into an error trying to create a dataset from a pandas dataframe.

import pandas as pd
import numpy as np 
from pydomo import Domo

dummy_name = 'Test | Dummy Data'
dummy_description = 'Description'

domo = Domo(clientid, secret, api_host='api.domo.com')

dummy_df = pd.DataFrame({'A':[1,2,3,4], 'B': [4,5,6,7]})

dummy_ds = domo.ds_create(df_up = dummy_df, name = dummy_name, description= dummy_description)

which leads to the following error message:


KeyError                                  Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_18908/1520357279.py in <module>
     13 dummy_df = pd.DataFrame({'A':[1,2,3,4], 'B': [4,5,6,7]})
     14 
---> 15 dummy_ds = domo.ds_create(df_up = dummy_df, name = dummy_name, description= dummy_description)

c:\Users\XXXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pydomo\__init__.py in ds_create(self, df_up, name, description, update_method, key_column_names)
    206     def ds_create(self, df_up, name, description='', update_method='REPLACE', key_column_names=''):
    207         new_stream = self.utilities.stream_create(df_up, name, description, update_method, key_column_names)
    208         ds_id = json.loads(new_stream.content.decode('utf-8'))['dataSet']['id']
    209         self.utilities.stream_upload(ds_id,df_up,warn_schema_change=False)
    210         return ds_id

KeyError: 'dataSet'

I am not sure what is causing this error.

@samrands
Copy link
Collaborator

@mvscarmack is this still an issue? My latest release (0.3.0.8) should at least log the response so you can see why the 'dataSet' key is missing (likely because of an error).

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