Skip to content

Commit 635d945

Browse files
committed
mypy casting
1 parent 4ef2528 commit 635d945

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/core/reshape/pivot.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TYPE_CHECKING, Callable, Dict, Tuple, Union
1+
from typing import cast, TYPE_CHECKING, Callable, Dict, Tuple, Union
22

33
import numpy as np
44

@@ -148,7 +148,8 @@ def pivot_table(
148148
table = table.sort_index(axis=1)
149149

150150
if fill_value is not None:
151-
table: "DataFrame" = table.fillna(value=fill_value, downcast="infer")
151+
filled = table.fillna(value=fill_value, downcast="infer")
152+
table = cast(DataFrame, filled)
152153

153154
if margins:
154155
if dropna:

0 commit comments

Comments
 (0)