Open NickCrews opened 2 weeks ago
EDIT: duh, it's because they don't guarantee row order. Updated the assertions to be order-independent.
Any idea as to why the datafusion, exasol, and risingwave column tests are failing? I still have trouble getting those backends running on my M1 so I can't debug locally very well.
@cpcloud gentle nudge for a review here :)
Redo of #7914 (with substantive changes) and #9039 (merely switching the base repo to the correct one, my fork)
Summary of changes:
ibis.null().cases((None, "fill"), else_="not hit")
always results in "not hit". Maybe not the best ergonomics, but at least it is consistent and written down. Perhaps we can revisit later. See one of the TODOs below.base
orcases
. Really it needs to depend on ALL inputs.ibis.cases()
(results in NULL) andibis.cases(else_=5)
(results in 5). I considered disallowing these, but I don't think there is anything semantiically wrong with supporting this.backends/test/test_generic.py
so they are run on all backends.TODOs that I found that should come in followups:
val.substitute({None: 4})
currently does a fillna(). But if you doval.cases((None, 4), else_=val)
, then this ALWAYS hits the else_ case, becausex = NULL
never evals to True. EXCECPT for clickhouse, which appears to special case this. See the addedtest_switch_cases_null
test. This also isn't even consistent in the sense that it only special cases for pythonNone
. If you doibis.null()
, or something only known at runtime likeibis.literal(5).nullif(5)
, then this will always hit the else_ case. Due to these limitations, I vote for making matching against NULLs out of scope for .cases and .substitute. If a user wants to do this, then they better do a .fillna() before.batting
table has a column RBI of type int64. On sqlite, this.to_pandas()
to a column of type object. I have this marked as broken here, but would be good to fix separately.Literal('foo', type=bool)
, should error, but doesn't