diff --git a/bigframes/series.py b/bigframes/series.py index 7e2b0408b7..7f0108b336 100644 --- a/bigframes/series.py +++ b/bigframes/series.py @@ -351,9 +351,11 @@ def drop( columns: Union[blocks.Label, typing.Iterable[blocks.Label]] = None, level: typing.Optional[LevelType] = None, ) -> Series: - if labels and index: - raise ValueError("Must specify exacly one of 'labels' or 'index'") - index = labels or index + if (labels is None) == (index is None): + raise ValueError("Must specify exactly one of 'labels' or 'index'") + + if labels is not None: + index = labels # ignore axis, columns params block = self._block diff --git a/tests/system/small/test_series.py b/tests/system/small/test_series.py index 794ab6b7a2..65ba6b0c27 100644 --- a/tests/system/small/test_series.py +++ b/tests/system/small/test_series.py @@ -1529,10 +1529,16 @@ def test_groupby_window_ops(scalars_df_index, scalars_pandas_df_index, operator) ) -def test_drop_label(scalars_df_index, scalars_pandas_df_index): - col_name = "int64_col" - bf_series = scalars_df_index[col_name].drop(1).to_pandas() - pd_series = scalars_pandas_df_index[col_name].drop(1) +@pytest.mark.parametrize( + ("label", "col_name"), + [ + (0, "bool_col"), + (1, "int64_col"), + ], +) +def test_drop_label(scalars_df_index, scalars_pandas_df_index, label, col_name): + bf_series = scalars_df_index[col_name].drop(label).to_pandas() + pd_series = scalars_pandas_df_index[col_name].drop(label) pd.testing.assert_series_equal( pd_series, bf_series,