Skip to content
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

GH26013 Fix type annotations in pandas/tseries/* #26014

Merged
merged 2 commits into from
Apr 7, 2019
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
9 changes: 0 additions & 9 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,6 @@ ignore_errors=True
[mypy-pandas.plotting._core]
ignore_errors=True

[mypy-pandas.tseries.frequencies]
ignore_errors=True

[mypy-pandas.tseries.holiday]
ignore_errors=True

[mypy-pandas.tseries.offsets]
ignore_errors=True

[mypy-pandas.util._doctools]
ignore_errors=True

Expand Down
3 changes: 2 additions & 1 deletion pandas/tseries/frequencies.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from datetime import timedelta
import re
from typing import Dict

import numpy as np
from pytz import AmbiguousTimeError
Expand Down Expand Up @@ -37,7 +38,7 @@
# Offset names ("time rules") and related functions

#: cache of previously seen offsets
_offset_map = {}
_offset_map = {} # type: Dict[str, DateOffset]


def get_period_alias(offset_str):
Expand Down
3 changes: 2 additions & 1 deletion pandas/tseries/holiday.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import datetime, timedelta
from typing import List
import warnings

from dateutil.relativedelta import FR, MO, SA, SU, TH, TU, WE # noqa
Expand Down Expand Up @@ -329,7 +330,7 @@ class AbstractHolidayCalendar(object):
Abstract interface to create holidays following certain rules.
"""
__metaclass__ = HolidayCalendarMetaClass
rules = []
rules = [] # type: List[Holiday]
start_date = Timestamp(datetime(1970, 1, 1))
end_date = Timestamp(datetime(2030, 12, 31))
_cache = None
Expand Down
5 changes: 3 additions & 2 deletions pandas/tseries/offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from datetime import date, datetime, timedelta
import functools
import operator
from typing import Optional

from dateutil.easter import easter
import numpy as np
Expand Down Expand Up @@ -1582,8 +1583,8 @@ class QuarterOffset(DateOffset):
"""
Quarter representation - doesn't call super.
"""
_default_startingMonth = None
_from_name_startingMonth = None
_default_startingMonth = None # type: Optional[int]
_from_name_startingMonth = None # type: Optional[int]
_adjust_dst = True
_attributes = frozenset(['n', 'normalize', 'startingMonth'])
# TODO: Consider combining QuarterOffset and YearOffset __init__ at some
Expand Down