Skip to content

Commit

Permalink
Fix nightly test (#751)
Browse files Browse the repository at this point in the history
* fix nightly test

* remove comment in template, nightly tests are not run for PRs
  • Loading branch information
twoertwein authored Jul 19, 2023
1 parent 8d5a827 commit 6c77062
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
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

0 comments on commit 6c77062

Please sign in to comment.