8000 TYP: offsets by jbrockmendel · Pull Request #30897 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content
8000

TYP: offsets #30897

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 7 commits into from
Jan 10, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
annotate
  • Loading branch information
jbrockmendel committed Jan 10, 2020
commit 61322d71f0117df35a51f19ecd487650cb0200db
4 changes: 2 additions & 2 deletions pandas/tseries/offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2516,7 +2516,7 @@ def apply(self, other):
)
return new

def is_on_offset(self, dt):
def is_on_offset(self, dt: datetime) -> bool:
if self.normalize and not _is_normalized(dt):
return False
return date(dt.year, dt.month, dt.day) == easter(dt.year)
Expand Down Expand Up @@ -2652,7 +2652,7 @@ def is_anchored(self) -> bool:
return False


def _delta_to_tick(delta):
def _delta_to_tick(delta: timedelta) -> Tick:
if delta.microseconds == 0 and getattr(delta, "nanoseconds", 0) == 0:
# nanoseconds only for pd.Timedelta
if delta.seconds == 0:
Expand Down
0