-
-
Notifications
You must be signed in to change notification settings - Fork 146
Add defaults for parameters #1293
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
yangdanny97
wants to merge
8
commits into
pandas-dev:main
Choose a base branch
from
yangdanny97:main
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 all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
047e5d2
add defaults for parameters
yangdanny97 2e371b6
add more defaults
yangdanny97 9617ee6
fix type errors
yangdanny97 e66384f
add more defaults
yangdanny97 b544b4e
fix deprecated function
yangdanny97 29d2fd7
apply defaults from source code
yangdanny97 ba9d227
address some comments and fix mypy
yangdanny97 e086068
remove fill_value from tests
yangdanny97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,12 +197,12 @@ class Period(PeriodMixin): | |
def day_of_year(self) -> int: ... | ||
@property | ||
def day_of_week(self) -> int: ... | ||
def asfreq(self, freq: str | BaseOffset, how: _PeriodFreqHow = ...) -> Period: ... | ||
def asfreq(self, freq: str | BaseOffset, how: _PeriodFreqHow = "end") -> Period: ... | ||
@classmethod | ||
def now(cls, freq: str | BaseOffset = ...) -> Period: ... | ||
def strftime(self, fmt: str) -> str: ... | ||
def to_timestamp( | ||
self, | ||
freq: str | BaseOffset | None = ..., | ||
how: _PeriodToTimestampHow = ..., | ||
how: _PeriodToTimestampHow = "S", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same issue as in I'm fine with leaving it as you have it, but open to which way to go. |
||
) -> Timestamp: ... |
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 | ||||
---|---|---|---|---|---|---|
|
@@ -115,15 +115,15 @@ class Timestamp(datetime, SupportsIndex): | |||||
@classmethod | ||||||
def utcfromtimestamp(cls, ts: float) -> Self: ... | ||||||
@classmethod | ||||||
def today(cls, tz: _tzinfo | str | None = ...) -> Self: ... | ||||||
def today(cls, tz: _tzinfo | str | None = None) -> Self: ... | ||||||
@classmethod | ||||||
def fromordinal( | ||||||
cls, | ||||||
ordinal: int, | ||||||
tz: _tzinfo | str | None = ..., | ||||||
) -> Self: ... | ||||||
@classmethod | ||||||
def now(cls, tz: _tzinfo | str | None = ...) -> Self: ... | ||||||
def now(cls, tz: _tzinfo | str | None = None) -> Self: ... | ||||||
@classmethod | ||||||
def utcnow(cls) -> Self: ... | ||||||
# error: Signature of "combine" incompatible with supertype "datetime" | ||||||
|
@@ -157,7 +157,7 @@ class Timestamp(datetime, SupportsIndex): | |||||
) -> Timestamp: ... | ||||||
def astimezone(self, tz: _tzinfo | None = ...) -> Self: ... | ||||||
def ctime(self) -> str: ... | ||||||
def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ... | ||||||
def isoformat(self, sep: str = "T", timespec: str = "auto") -> str: ... | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
@classmethod | ||||||
def strptime(cls, date_string: Never, format: Never) -> Never: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] | ||||||
def utcoffset(self) -> timedelta | None: ... | ||||||
|
@@ -276,31 +276,31 @@ class Timestamp(datetime, SupportsIndex): | |||||
def tz_localize( | ||||||
self, | ||||||
tz: TimeZones, | ||||||
ambiguous: _Ambiguous = ..., | ||||||
nonexistent: TimestampNonexistent = ..., | ||||||
ambiguous: _Ambiguous = "raise", | ||||||
nonexistent: TimestampNonexistent = "raise", | ||||||
) -> Self: ... | ||||||
def normalize(self) -> Self: ... | ||||||
# TODO: round/floor/ceil could return NaT? | ||||||
def round( | ||||||
self, | ||||||
freq: str, | ||||||
ambiguous: _Ambiguous = ..., | ||||||
nonexistent: TimestampNonexistent = ..., | ||||||
ambiguous: _Ambiguous = "raise", | ||||||
nonexistent: TimestampNonexistent = "raise", | ||||||
) -> Self: ... | ||||||
def floor( | ||||||
self, | ||||||
freq: str, | ||||||
ambiguous: _Ambiguous = ..., | ||||||
nonexistent: TimestampNonexistent = ..., | ||||||
ambiguous: _Ambiguous = "raise", | ||||||
nonexistent: TimestampNonexistent = "raise", | ||||||
) -> Self: ... | ||||||
def ceil( | ||||||
self, | ||||||
freq: str, | ||||||
ambiguous: _Ambiguous = ..., | ||||||
nonexistent: TimestampNonexistent = ..., | ||||||
ambiguous: _Ambiguous = "raise", | ||||||
nonexistent: TimestampNonexistent = "raise", | ||||||
) -> Self: ... | ||||||
def day_name(self, locale: str | None = ...) -> str: ... | ||||||
def month_name(self, locale: str | None = ...) -> str: ... | ||||||
def day_name(self, locale: str | None = None) -> str: ... | ||||||
def month_name(self, locale: str | None = None) -> str: ... | ||||||
@property | ||||||
def day_of_week(self) -> int: ... | ||||||
@property | ||||||
|
@@ -322,6 +322,6 @@ class Timestamp(datetime, SupportsIndex): | |||||
def daysinmonth(self) -> int: ... | ||||||
@property | ||||||
def unit(self) -> TimeUnit: ... | ||||||
def as_unit(self, unit: TimeUnit, round_ok: bool = ...) -> Self: ... | ||||||
def as_unit(self, unit: TimeUnit, round_ok: bool = True) -> Self: ... | ||||||
# To support slicing | ||||||
def __index__(self) -> int: ... |
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
Oops, something went wrong.
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.
Not sure whether this matters. Code has default of
how
as"E"
, but docs say"end"
I'm fine with leaving it as you have it, but open to which way to go.