Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

test_boolean_casting failing #89

Open
tswast opened this issue Jul 9, 2021 · 0 comments
Open

test_boolean_casting failing #89

tswast opened this issue Jul 9, 2021 · 0 comments

Comments

@tswast
Copy link
Collaborator

tswast commented Jul 9, 2021

_____________________________ 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'
@tswast tswast mentioned this issue Jul 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant