Skip to content

Fix nightly test #751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 19, 2023
Merged
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
4 changes: 0 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
<!--
Two CI tests are using not yet released versions of pandas ("nightly") and mypy ("mypy_nightly"). It is okay if they fail.
-->

- [ ] Closes #xxxx (Replace xxxx with the Github issue number)
- [ ] Tests added: Please use `assert_type()` to assert the type of any return value
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ ci:
autofix_prs: false
repos:
- repo: https://github.com/python/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.9.0
hooks:
- id: pyupgrade
types_or: [python, pyi]
Expand All @@ -27,15 +27,15 @@ repos:
- id: flake8
name: flake8 (pyi)
additional_dependencies:
- flake8-pyi==23.3.1
- flake8-pyi==23.6.0
types: [pyi]
args: [
--ignore=E301 E302 E305 E402 E501 E701 E704 F401 F811 W503 Y042,
--ignore=E301 E302 E305 E402 E501 E701 E704 F401 F811 F821 W503 Y042,
# TypeVars in private files are already private
--per-file-ignores=_*.pyi:Y001
]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.5
hooks:
- id: codespell
additional_dependencies: [ tomli ]
4 changes: 2 additions & 2 deletions pandas-stubs/_typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ AxisColumn: TypeAlias = Literal["columns", 1]
Axis: TypeAlias = AxisIndex | AxisColumn
DtypeNp = TypeVar("DtypeNp", bound=np.dtype[np.generic])
KeysArgType: TypeAlias = Any
ListLike = TypeVar("ListLike", Sequence, np.ndarray, "Series", "Index")
ListLike = TypeVar("ListLike", Sequence, np.ndarray, Series, Index)
ListLikeExceptSeriesAndStr = TypeVar(
"ListLikeExceptSeriesAndStr", MutableSequence, np.ndarray, tuple, "Index"
"ListLikeExceptSeriesAndStr", MutableSequence, np.ndarray, tuple, Index
)
ListLikeU: TypeAlias = Sequence | np.ndarray | Series | Index
ListLikeHashable: TypeAlias = (
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/accessors.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class _MiniSeconds(Generic[_DTFieldOpsReturnType]):
@property
def nanosecond(self) -> _DTFieldOpsReturnType: ...

_DTBoolOpsReturnType = TypeVar("_DTBoolOpsReturnType", "Series[bool]", np_ndarray_bool)
_DTBoolOpsReturnType = TypeVar("_DTBoolOpsReturnType", Series[bool], np_ndarray_bool)

class _IsLeapYearProperty(Generic[_DTBoolOpsReturnType]):
@property
Expand Down
8 changes: 1 addition & 7 deletions tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,7 @@ def square(x: float) -> float:
def makeseries(x: float) -> pd.Series:
return pd.Series([x, 2 * x])

with pytest_warns_bounded(
FutureWarning,
"Returning a DataFrame from Series.apply when the supplied function"
"returns a Series is deprecated",
lower="2.0.99",
):
check(assert_type(s.apply(makeseries), pd.DataFrame), pd.DataFrame)
check(assert_type(s.apply(makeseries), pd.DataFrame), pd.DataFrame)

# GH 293

Expand Down