Skip to content

Commit 11ed16b

Browse files
authored
cleanup type errors in tests/unit/test_pandas.py (#767)
1 parent 3076a13 commit 11ed16b

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

bigframes/core/reshape/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def cut(
116116
Iterable,
117117
],
118118
*,
119-
labels: Optional[bool] = None,
119+
labels: Union[Iterable[str], bool, None] = None,
120120
) -> bigframes.series.Series:
121121
if isinstance(bins, int) and bins <= 0:
122122
raise ValueError("`bins` should be a positive integer.")

bigframes/pandas/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def cut(
142142
x: bigframes.series.Series,
143143
bins: int,
144144
*,
145-
labels: Optional[bool] = None,
145+
labels: Union[Iterable[str], bool, None] = None,
146146
) -> bigframes.series.Series:
147147
return bigframes.core.reshape.cut(
148148
x,

tests/unit/test_pandas.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ def test_cut_raises_with_labels():
9595
match="The 'labels' parameter must be either False or None.",
9696
):
9797
mock_series = mock.create_autospec(bigframes.pandas.Series, instance=True)
98-
# TODO(b/340893280): fix type error
99-
bigframes.pandas.cut(mock_series, 4, labels=["a", "b", "c", "d"]) # type: ignore
98+
bigframes.pandas.cut(mock_series, 4, labels=["a", "b", "c", "d"])
10099

101100

102101
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)