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: 'type' with qri.get().body #31

Open
xxristoskk opened this issue Sep 8, 2020 · 2 comments
Open

KeyError: 'type' with qri.get().body #31

xxristoskk opened this issue Sep 8, 2020 · 2 comments

Comments

@xxristoskk
Copy link
Contributor

What is your OS and version?

Linux Mint Cinnamon 20

What version of qri are you using (qri version)?

0.9.11

Issue

Getting a KeyError when trying to get qri_weather_bot/earthquakes-test. I suspected it was a JSON, but it's a CSV.

@dustmop
Copy link
Contributor

dustmop commented Sep 8, 2020

Could you include a stacktrace please?

@xxristoskk
Copy link
Contributor Author

@dustmop yep!

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-5-f8b4eb90a3bd> in <module>
----> 1 df = qri.get('qri_weather_bot/earthquakes-test').body

~/datasets/notebooks/qri/dataset.py in body(self)
     92       raise RuntimeError('Only csv body format is supported')
     93     if self.body_component is None:
---> 94       df = loader.load_body(self.username, self.name, self.structure)
     95       self.body_component = df
     96     return self.body_component

~/datasets/notebooks/qri/loader.py in load_body(username, dsname, structure)
     15   columns = [e for e in structure.schema['items']['items']]
     16   col_names = [c['title'] for c in columns]
---> 17   types = {c['title']: pd_type(c['type']) for c in columns}
     18   header = 0 if structure.format_config.get('headerRow') else None
     19   df = None

~/datasets/notebooks/qri/loader.py in <dictcomp>(.0)
     15   columns = [e for e in structure.schema['items']['items']]
     16   col_names = [c['title'] for c in columns]
---> 17   types = {c['title']: pd_type(c['type']) for c in columns}
     18   header = 0 if structure.format_config.get('headerRow') else None
     19   df = None

KeyError: 'type'

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