Skip to content

Commit 2842d5f

Browse files
committed
Made some changes:
- Removed stub and test for applymap - Downgraded pyright - Ran the precommit (it just removes some whitespace)
1 parent 911dc2e commit 2842d5f

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

pandas-stubs/core/frame.pyi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,14 +1316,10 @@ class DataFrame(NDFrame, OpsMixin):
13161316
) -> DataFrame: ...
13171317

13181318
# Add spacing between apply() overloads and remaining annotations
1319-
# Deprecated in pandas 2.1.0 and later
1320-
def applymap(
1321-
self, func: Callable, na_action: Literal["ignore"] | None = ..., **kwargs
1322-
) -> DataFrame: ...
13231319
# In pandas 2.1.0 and later: applymap is renamed map, applymap is deprecated
13241320
def map(
13251321
self, func: Callable, na_action: Literal["ignore"] | None = ..., **kwargs
1326-
) -> DataFrame: ...
1322+
) -> DataFrame: ...
13271323
def join(
13281324
self,
13291325
other: DataFrame | Series | list[DataFrame | Series],

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ mypy = "1.6.0"
3939
pandas = "2.1.1"
4040
pyarrow = ">=10.0.1"
4141
pytest = ">=7.1.2"
42-
pyright = ">=1.1.331"
42+
pyright = "==1.1.331"
4343
poethepoet = ">=0.16.5"
4444
loguru = ">=0.6.0"
4545
typing-extensions = ">=4.4.0"

tests/test_frame.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -728,21 +728,7 @@ def gethead(s: pd.Series, y: int) -> pd.Series:
728728
)
729729

730730

731-
# Deprecated in pandas 2.1.0
732-
def test_types_applymap() -> None:
733-
with pytest_warns_bounded(
734-
FutureWarning, "DataFrame.applymap has been deprecated", lower="2.0.99"
735-
):
736-
df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]})
737-
df.applymap(lambda x: x**2)
738-
df.applymap(np.exp)
739-
df.applymap(str)
740-
# na_action parameter was added in 1.2.0 https://pandas.pydata.org/docs/whatsnew/v1.2.0.html
741-
df.applymap(np.exp, na_action="ignore")
742-
df.applymap(str, na_action=None)
743-
744-
745-
# Added in pandas 2.1.0
731+
# In pandas 2.1.0 and later: applymap is renamed map, applymap is deprecated
746732
def test_types_map() -> None:
747733
df = pd.DataFrame(data={"col1": [2, 1], "col2": [3, 4]})
748734
df.map(lambda x: x**2)

0 commit comments

Comments
 (0)