Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions python/pyspark/pandas/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -6126,6 +6126,13 @@ def interpolate(
raise ValueError("invalid limit_direction: '{}'".format(limit_direction))
if (limit_area is not None) and (limit_area not in ["inside", "outside"]):
raise ValueError("invalid limit_area: '{}'".format(limit_area))
for dtype in self.dtypes.values:
if dtype == "object":
warnings.warn(
"DataFrame.interpolate with object dtype is deprecated and will raise in a "
"future version. Convert to a specific numeric type before interpolating.",
FutureWarning,
)

numeric_col_names = []
for label in self._internal.column_labels:
Expand Down
6 changes: 6 additions & 0 deletions python/pyspark/pandas/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2231,6 +2231,12 @@ def _interpolate(
limit_direction: Optional[str] = None,
limit_area: Optional[str] = None,
) -> "Series":
if self.dtype == "object":
warnings.warn(
"Series.interpolate with object dtype is deprecated and will raise in a "
"future version. Convert to a specific numeric type before interpolating.",
FutureWarning,
)
if method not in ["linear"]:
raise NotImplementedError("interpolate currently works only for method='linear'")
if (limit is not None) and (not limit > 0):
Expand Down