Skip to content

Commit 8595dda

Browse files
committed
TYP: improved _cubicspline_interpolate function annotations
1 parent 3d75afd commit 8595dda

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pandas/core/missing.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@
4545
)
4646

4747
if TYPE_CHECKING:
48+
from typing import TypeAlias
49+
4850
from pandas import Index
4951

52+
_CubicBC: TypeAlias = Literal["not-a-knot", "clamped", "natural", "periodic"]
53+
5054

5155
def check_value_size(value, mask: npt.NDArray[np.bool_], length: int):
5256
"""
@@ -700,9 +704,9 @@ def _cubicspline_interpolate(
700704
yi: np.ndarray,
701705
x: np.ndarray,
702706
axis: AxisInt = 0,
703-
bc_type: str | tuple[Any, Any] = "not-a-knot",
704-
extrapolate=None,
705-
):
707+
bc_type: _CubicBC | tuple[Any, Any] = "not-a-knot",
708+
extrapolate: Literal["periodic"] | bool | None = None,
709+
) -> np.ndarray:
706710
"""
707711
Convenience function for cubic spline data interpolator.
708712

0 commit comments

Comments
 (0)