-
-
Notifications
You must be signed in to change notification settings - Fork 157
Drop ANN exceptions from *arrays* and core/base.py #1568
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
Open
loicdiridollou
wants to merge
14
commits into
pandas-dev:main
Choose a base branch
from
loicdiridollou:gh1318_defaults_p2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3028115
GH1317 Add more defaults
loicdiridollou 77ddea8
GH1317 Add more defaults
loicdiridollou 6d78fd5
GH1317 Add more defaults
loicdiridollou 95812e1
Apply suggestions from code review
loicdiridollou 0d592ce
Drop ANN exceptions from *arrays* and core/base.py
loicdiridollou 3db3e22
Merge branch 'main' into gh1318_defaults_p2
loicdiridollou 51d4e03
Fix issues
loicdiridollou c9e5a3e
Fix issues
loicdiridollou ef42649
Fix issues
loicdiridollou 7c7c9cc
Fix issues
loicdiridollou ac0a84c
Fix issues
loicdiridollou 2526813
Merge branch 'main' of github.com:loicdiridollou/pandas-stubs into gh…
loicdiridollou 33740e3
GH1318 PR Feedback
loicdiridollou 6b116b3
GH1317 PR Feedback
loicdiridollou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,13 +3,21 @@ import sys | |
| from typing import Any | ||
|
|
||
| import numpy as np | ||
| import numpy.typing as npt | ||
| from pandas.core.arrays.datetimelike import ( | ||
| DatelikeOps, | ||
| DatetimeLikeArrayMixin, | ||
| TimelikeOps, | ||
| ) | ||
| from pandas.core.arrays.period import PeriodArray | ||
| from pandas.core.indexes.base import Index | ||
| from pandas.core.series import Series | ||
| from typing_extensions import Self | ||
|
|
||
| from pandas._libs.tslibs.period import Period | ||
| from pandas._typing import ( | ||
| DtypeArg, | ||
| Frequency, | ||
| TimeAmbiguous, | ||
| TimeNonexistent, | ||
| TimeZones, | ||
|
|
@@ -19,7 +27,13 @@ from pandas.core.dtypes.dtypes import DatetimeTZDtype as DatetimeTZDtype | |
|
|
||
| class DatetimeArray(DatetimeLikeArrayMixin, TimelikeOps, DatelikeOps): | ||
| __array_priority__: int = ... | ||
| def __init__(self, values, dtype=..., freq=..., copy: bool = ...) -> None: ... | ||
| def __init__( | ||
| self, | ||
| values: Series | Index | DatetimeArray | npt.NDArray[np.object_], | ||
| dtype: DtypeArg | None = None, | ||
| freq: Frequency | None = None, | ||
| copy: bool = False, | ||
| ) -> None: ... | ||
| # ignore in dtype() is from the pandas source | ||
| if sys.version_info >= (3, 11): | ||
| @property | ||
|
|
@@ -28,34 +42,28 @@ class DatetimeArray(DatetimeLikeArrayMixin, TimelikeOps, DatelikeOps): | |
| @property | ||
| def dtype(self) -> np.dtype[Any] | DatetimeTZDtype: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] | ||
|
|
||
| @property | ||
| def tz(self): ... | ||
| @tz.setter | ||
| def tz(self, value) -> None: ... | ||
| @property | ||
| def tzinfo(self) -> _tzinfo | None: ... | ||
| @property | ||
| def is_normalized(self): ... | ||
| def __iter__(self): ... | ||
| def tz_convert(self, tz: TimeZones): ... | ||
| def is_normalized(self) -> bool: ... | ||
| def tz_convert(self, tz: TimeZones) -> Self: ... | ||
| def tz_localize( | ||
| self, | ||
| tz: TimeZones, | ||
| ambiguous: TimeAmbiguous = "raise", | ||
| nonexistent: TimeNonexistent = "raise", | ||
| ): ... | ||
| def to_pydatetime(self): ... | ||
| def normalize(self): ... | ||
| def to_period(self, freq=...): ... | ||
| def to_perioddelta(self, freq): ... | ||
| def month_name(self, locale=...): ... | ||
| def day_name(self, locale=...): ... | ||
| ) -> Self: ... | ||
| def to_pydatetime(self) -> npt.NDArray[np.object_]: ... | ||
| def normalize(self) -> Self: ... | ||
| def to_period(self, freq: str | Period | None = None) -> PeriodArray: ... | ||
| def month_name(self, locale: str | None = None) -> Series | Index: ... | ||
| def day_name(self, locale: str | None = None) -> Series | Index: ... | ||
| @property | ||
| def time(self): ... | ||
| def time(self) -> npt.NDArray[np.object_]: ... | ||
| @property | ||
| def timetz(self): ... | ||
| def timetz(self) -> npt.NDArray[np.object_]: ... | ||
| @property | ||
| def date(self): ... | ||
| def date(self) -> npt.NDArray[np.object_]: ... | ||
| year = ... | ||
| month = ... | ||
| day = ... | ||
|
|
@@ -77,4 +85,4 @@ class DatetimeArray(DatetimeLikeArrayMixin, TimelikeOps, DatelikeOps): | |
| is_year_start = ... | ||
| is_year_end = ... | ||
| is_leap_year = ... | ||
| def to_julian_date(self): ... | ||
| def to_julian_date(self) -> npt.NDArray[np.float64]: ... | ||
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe
np_1darray_object, also in other cases here