This repository has been archived by the owner on Mar 29, 2023. It is now read-only.
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.
Open
Description
_____________________________ test_boolean_casting _____________________________
alltypes = BigQueryTable[table]
name: ibis-gbq.testing.functional_alltypes
schema:
index : int64
Unnamed_0 : int64
...4
date_string_col : string
string_col : string
timestamp_col : timestamp
year : int64
month : int64
def test_boolean_casting(alltypes):
t = alltypes
expr = t.groupby(k=t.string_col.nullif("1") == "9").count()
result = expr.execute().set_index("k")
count = result["count"]
> assert count.loc[False] == 5840
tests/system/test_client.py:714:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.local/lib/python3.8/site-packages/pandas/core/indexing.py:931: in __getitem__
return self._getitem_axis(maybe_callable, axis=axis)
../../../.local/lib/python3.8/site-packages/pandas/core/indexing.py:1163: in _getitem_axis
self._validate_key(key, axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pandas.core.indexing._LocIndexer object at 0x7f512c837900>, key = False
axis = 0
@doc(_LocationIndexer._validate_key)
def _validate_key(self, key, axis: int):
# valid for a collection of labels (we check their presence later)
# slice of labels (where start-end in labels)
# slice of integers (only if in the labels)
# boolean not in slice and with boolean index
if isinstance(key, bool) and not is_bool_dtype(self.obj.index):
> raise KeyError(
f"{key}: boolean label can not be used without a boolean index"
)
E KeyError: 'False: boolean label can not be used without a boolean index'
Metadata
Assignees
Labels
No labels