Skip to content

Commit 32d0c23

Browse files
committed
chore: adjusts type hints to account for complications with mypy part 3
1 parent aa6e4d8 commit 32d0c23

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/bigframes/bigframes/dataframe.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3926,12 +3926,13 @@ def round(self, decimals: Union[int, dict[Hashable, int]] = 0) -> DataFrame:
39263926
bigframes.dtypes.BOOL_DTYPE
39273927
}:
39283928
if is_mapping:
3929-
if label in decimals: # type: ignore
3929+
decimals_dict = typing.cast(dict[typing.Hashable, int], decimals)
3930+
if label in decimals_dict:
39303931
exprs.append(
39313932
ops.round_op.as_expr(
39323933
col_id,
39333934
ex.const(
3934-
decimals[label],
3935+
decimals_dict[label],
39353936
dtype=bigframes.dtypes.INT_DTYPE, # type: ignore
39363937
),
39373938
)
@@ -4447,8 +4448,8 @@ def to_latex(
44474448
) -> str | None:
44484449
return self.to_pandas(allow_large_results=allow_large_results).to_latex(
44494450
buf,
4450-
columns=columns,
4451-
header=header,
4451+
columns=typing.cast(typing.Optional[list[str]], columns),
4452+
header=typing.cast(typing.Union[bool, list[str]], header),
44524453
index=index,
44534454
**kwargs, # type: ignore
44544455
)

0 commit comments

Comments
 (0)