Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Made some changes:
- Removed stub and test for applymap
- Downgraded pyright
- Ran the precommit (it just removes some whitespace)
  • Loading branch information
andrewpmk committed Oct 21, 2023
commit 463ec53a84ac539bd2b86da82b22eecb09f7d5fb
6 changes: 1 addition & 5 deletions pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1316,14 +1316,10 @@ class DataFrame(NDFrame, OpsMixin):
) -> DataFrame: ...

# Add spacing between apply() overloads and remaining annotations
# Deprecated in pandas 2.1.0 and later
def applymap(
self, func: Callable, na_action: Literal["ignore"] | None = ..., **kwargs
) -> DataFrame: ...
# In pandas 2.1.0 and later: applymap is renamed map, applymap is deprecated
def map(
self, func: Callable, na_action: Literal["ignore"] | None = ..., **kwargs
) -> DataFrame: ...
) -> DataFrame: ...
def join(
self,
other: DataFrame | Series | list[DataFrame | Series],
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ mypy = "1.6.0"
pandas = "2.1.1"
pyarrow = ">=10.0.1"
pytest = ">=7.1.2"
pyright = ">=1.1.331"
pyright = "==1.1.331"
poethepoet = ">=0.16.5"
loguru = ">=0.6.0"
typing-extensions = ">=4.4.0"
Expand Down
16 changes: 1 addition & 15 deletions tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,21 +728,7 @@ def gethead(s: pd.Series, y: int) -> pd.Series:
)


# Deprecated in pandas 2.1.0
def test_types_applymap() -> None:
with pytest_warns_bounded(
FutureWarning, "DataFrame.applymap has been deprecated", lower="2.0.99"
):
df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]})
df.applymap(lambda x: x**2)
df.applymap(np.exp)
df.applymap(str)
# na_action parameter was added in 1.2.0 https://pandas.pydata.org/docs/whatsnew/v1.2.0.html
df.applymap(np.exp, na_action="ignore")
df.applymap(str, na_action=None)


# Added in pandas 2.1.0
# In pandas 2.1.0 and later: applymap is renamed map, applymap is deprecated
def test_types_map() -> None:
df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]})
df.map(lambda x: x**2)
Expand Down