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

thrift_cast method with the mapdtype BOOL failed to handle columns having string boolean type #267

Open
Avinash-Raj opened this issue Sep 19, 2019 · 1 comment

Comments

@Avinash-Raj
Copy link

As for now thrift_cast method on _pandas_loaders.py failed to handle columns having string bool type. We have to do an initial cleanup before converting the boolean type to int like we did for NaN values on boolean column.

**How to reproduce? **

from pymapd._pandas_loaders import thrift_cast
kdf = pd.DataFrame(data={'col1' : [True, 'True', np.nan], 'dt': [datetime.now(), ' 2018-12-12', '2019-12-12'], 'bool': 
                         [False, True, True], 'bnan': [False, True, np.nan]})
thrift_cast(kdf['col1'], 'BOOL', 0)

should raises

ValueError: invalid literal for int() with base 10: 'True'
@randyzwitch
Copy link
Contributor

I'm not sure we really want to get into this level of "do what I mean". We'd have to scan every string column to see what special values might be present, then auto-convert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants