DT[f.A == "", :] is bugged for columns with all empty strings

Open
#3,394 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, python
Domain
data

Research direction

Start by running the Python reproduction in the issue with a datatable frame whose column contains only empty strings, then trace the filtering and string-comparison path used by DT[f.A == "", :]. Done means the expression returns a count of 2, with a regression test covering an all-empty-string column and the existing mixed-value behavior.

Written by the indexing model from the issue text.

Description

bug
from datatable import dt, f

DT = dt.Frame({"A": ["", ""]})
DT[f.A == "", dt.count()][0, 0]
# 0

If any value in the column is not an empty string, it works as expected.

Workaround:

DT[dt.str.len(f.A) == 0, dt.count()][0, 0]
# 2
Dominant language
C++
Stars
1.9k
Forks
164
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from h2oai/datatable

All issues in h2oai/datatable

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.