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

Filtering by a None value in a string column doesn't work. #1912

Closed
mdymczyk opened this issue Jul 12, 2019 · 0 comments · Fixed by #1914
Closed

Filtering by a None value in a string column doesn't work. #1912

mdymczyk opened this issue Jul 12, 2019 · 0 comments · Fixed by #1914
Assignees
Labels
bug Any bugs / errors in datatable; however for severe bugs use [segfault] label
Milestone

Comments

@mdymczyk
Copy link

mdymczyk commented Jul 12, 2019

When there's a missing value in the column, if I get all the unique values from it using dt.unique I can then filter rows using frame[f.column == uniques[idx]] for every unique value but the missing None one, which fails with an error. Now whether this is working as intended or not I'm not sure but at least I think we can improve the error message.

Repro:

>>> import datatable as dt
>>> from datatable import f
>>> dataset = dt.Frame([[None, '1','2']], names=['a'])
>>> ref_levels = dt.unique(dataset[:, 'a']).to_list()[0]
>>> dataset[f.a == ref_levels[2], :]
    a
--  --
 0  2

[1 row x 1 column]
>>> dataset[f.a == ref_levels[1], :]
    a
--  --
 0  1

[1 row x 1 column]
>>> dataset[f.a == ref_levels[0], :]
TypeError: Binary operator == cannot be applied to columns with stypes str32 and bool8

>>> ref_levels
[None, '1', '2']

I tried the above with some numeric types (also floats) and all seems to work fine then.

@mdymczyk mdymczyk added the bug Any bugs / errors in datatable; however for severe bugs use [segfault] label label Jul 12, 2019
@st-pasha st-pasha changed the title Filtering by a None unique value doesn't work. Filtering by a None value in a string column doesn't work. Jul 12, 2019
@st-pasha st-pasha self-assigned this Jan 29, 2020
@st-pasha st-pasha added this to the Release 0.9.0 milestone Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Any bugs / errors in datatable; however for severe bugs use [segfault] label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants