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

Provide support for Enum #23

Open
zotttttttt opened this issue Nov 21, 2019 · 0 comments
Open

Provide support for Enum #23

zotttttttt opened this issue Nov 21, 2019 · 0 comments

Comments

@zotttttttt
Copy link

Right now pandahouse throws this error when you're querying some column with enum value in it:

df = pdch.read_clickhouse(query, connection=connection)

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<timed exec> in <module>

~/anaconda3/lib/python3.6/site-packages/pandahouse/core.py in read_clickhouse(query, tables, index, connection, **kwargs)
     56     lines = execute(query, external=external, stream=True,
     57                     connection=connection)
---> 58     return to_dataframe(lines, **kwargs)
     59 
     60 

~/anaconda3/lib/python3.6/site-packages/pandahouse/convert.py in to_dataframe(lines, **kwargs)
     65     dtypes, parse_dates, converters = {}, [], {}
     66     for name, chtype in zip(names, types):
---> 67         dtype = CH2PD[chtype]
     68         if dtype == 'object':
     69             converters[name] = decode_escapes
KeyError: "Enum8(\\'one\\' = 1, \\'two\\' = 2)"

You can learn more about enum here (if you need it)

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

1 participant