[BUG] Consistency in column selection
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 164
- Avg merge
- 7h 31m
- Merged PRs (30d)
- 1
Description
- Did you find a bug in datatable, or maybe the bug found you?
`f` symbol accepts mixed-selector types in the `j` section, which is not allowed when not selecting with the `f` symbol.
- How to reproduce the bug?
```python
from datatable import dt, f
DF = dt.Frame(
{
"V1": [1, 2, 1, 2, 1, 2, 1, 2, 1],
"V2": [1, 2, 3, 4, 5, 6, 7, 8, 9],
"V3": [0.5, 1.0, 1.5] * 3,
"V4": ["A", "B", "C"] * 3,
}
)
DF
| V1 V2 V3 V4
| int32 int32 float64 str32
-- + ----- ----- ------- -----
0 | 1 1 0.5 A
1 | 2 2 1 B
2 | 1 3 1.5 C
3 | 2 4 0.5 A
4 | 1 5 1 B
5 | 2 6 1.5 C
6 | 1 7 0.5 A
7 | 2 8 1 B
8 | 1 9 1.5 C
[9 rows x 4 columns]
In [161]: DF[:, ['V1', 0]]
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in
----> 1 DF[:, ['V1', 0]]
TypeError: Mixed selector types are not allowed. Element 1 is of type integer, whereas the previous element(s) were of type string
In [162]: DF[:, f['V1', 0]]
Out[162]:
| V1 V2
| int32 int32
-- + ----- -----
0 | 1 1
1 | 2 2
2 | 1 1
3 | 2 2
4 | 1 1
5 | 2 2
6 | 1 1
7 | 2 2
8 | 1 1
[9 rows x 2 columns]
```
- What was the expected behavior?
I think `f` should return a TypeError if the selector types are mixed
- Your environment?
python: '3.9.2 | packaged by conda-forge | (default, Feb 21 2021, 05:02:46) \n[GCC 9.3.0]'
datatable: '1.0.0a0+build.1615412817.sam'
os: linux
Contributor guide
Assessment
This issue has not been assessed yet.