Open lexual opened 2 days ago
Thanks for flagging this! The issue is that cases
was introduced in https://github.com/ibis-project/ibis/pull/9096 about a month after the 9.5 release.
If you do not want to install from source, you can still use case
with only the column like this particular example: v.case().when(1, "a").when(2, "b").else_("unk").end()
or with the table expression like:
In [1]: import ibis
...: ibis.options.interactive = True
...: t = ibis.memtable({"values": [1, 2, 1, 2, 3, 2, 4]})
In [2]: t.mutate(
...: case_expr=ibis.case()
...: .when(t.values == 1, "a")
...: .when(t.values == 2, "b")
...: .else_("unk")
...: .end()
...: )
Out[2]:
┏━━━━━━━━┳━━━━━━━━━━━┓
┃ values ┃ case_expr ┃
┡━━━━━━━━╇━━━━━━━━━━━┩
│ int64 │ string │
├────────┼───────────┤
│ 1 │ a │
│ 2 │ b │
│ 1 │ a │
│ 2 │ b │
│ 3 │ unk │
│ 2 │ b │
│ 4 │ unk │
└────────┴───────────┘
I apologize for the inconvenience; I can understand how frustrating this is. We should get another release out before too long.
Thanks @IndexSeek
Appreciate the apology, but not a big deal for me. Is the next release likely to be any time soon?
This is bad UX for an end user. It could be worth considering any of the following, which might help with this issue:
Thanks.
Please describe the issue
Can't get the conditional cases() examples to work (as opposed matching on a value), am I missing something?:
I tried other examples that specify I should be using
else_
kwarg, and it complains about it not existing, and it looks like it should bedefault
?This is another verbatim from the docs:
Code of Conduct