|
1 | 1 | from datetime import date, datetime, time as dt_time, timedelta
|
2 |
| - |
| 2 | +from typing import List, Tuple, Dict, Union, Callable |
3 | 3 | import numpy as np
|
4 | 4 | import pytest
|
5 | 5 |
|
@@ -92,7 +92,7 @@ def test_to_M8():
|
92 | 92 |
|
93 | 93 |
|
94 | 94 | class Base:
|
95 |
| - _offset = None |
| 95 | + _offset = None # type: Union[BusinessHour, CustomBusinessHour, Callable] |
96 | 96 | d = Timestamp(datetime(2008, 1, 2))
|
97 | 97 |
|
98 | 98 | timezones = [
|
@@ -659,7 +659,7 @@ def test_eq(self):
|
659 | 659 |
|
660 | 660 |
|
661 | 661 | class TestBusinessDay(Base):
|
662 |
| - _offset = BDay |
| 662 | + _offset = BDay # type: Callable |
663 | 663 |
|
664 | 664 | def setup_method(self, method):
|
665 | 665 | self.d = datetime(2008, 1, 1)
|
@@ -740,7 +740,7 @@ def test_onOffset(self):
|
740 | 740 | for offset, d, expected in tests:
|
741 | 741 | assert_onOffset(offset, d, expected)
|
742 | 742 |
|
743 |
| - apply_cases = [] |
| 743 | + apply_cases = [] # type: List[Tuple[int, Dict[datetime, datetime]]] |
744 | 744 | apply_cases.append(
|
745 | 745 | (
|
746 | 746 | BDay(),
|
@@ -1697,7 +1697,7 @@ def test_opening_time(self, case):
|
1697 | 1697 | assert offset._next_opening_time(dt) == exp_next
|
1698 | 1698 | assert offset._prev_opening_time(dt) == exp_prev
|
1699 | 1699 |
|
1700 |
| - apply_cases = [] |
| 1700 | + apply_cases = [] # type: List[Tuple[int, Dict[datetime, datetime]]] |
1701 | 1701 | apply_cases.append(
|
1702 | 1702 | (
|
1703 | 1703 | BusinessHour(),
|
@@ -2631,7 +2631,7 @@ def test_onOffset(self, case):
|
2631 | 2631 | apply_cases = []
|
2632 | 2632 | apply_cases.append(
|
2633 | 2633 | (
|
2634 |
| - CDay(), |
| 2634 | + 1 * CDay(), |
2635 | 2635 | {
|
2636 | 2636 | datetime(2008, 1, 1): datetime(2008, 1, 2),
|
2637 | 2637 | datetime(2008, 1, 4): datetime(2008, 1, 7),
|
@@ -2878,7 +2878,7 @@ def test_onOffset(self, case):
|
2878 | 2878 | apply_cases = []
|
2879 | 2879 | apply_cases.append(
|
2880 | 2880 | (
|
2881 |
| - CBMonthEnd(), |
| 2881 | + 1 * CBMonthEnd(), |
2882 | 2882 | {
|
2883 | 2883 | datetime(2008, 1, 1): datetime(2008, 1, 31),
|
2884 | 2884 | datetime(2008, 2, 7): datetime(2008, 2, 29),
|
@@ -3027,7 +3027,7 @@ def test_onOffset(self, case):
|
3027 | 3027 | apply_cases = []
|
3028 | 3028 | apply_cases.append(
|
3029 | 3029 | (
|
3030 |
| - CBMonthBegin(), |
| 3030 | + 1 * CBMonthBegin(), |
3031 | 3031 | {
|
3032 | 3032 | datetime(2008, 1, 1): datetime(2008, 2, 1),
|
3033 | 3033 | datetime(2008, 2, 7): datetime(2008, 3, 3),
|
@@ -3120,7 +3120,7 @@ def test_datetimeindex(self):
|
3120 | 3120 |
|
3121 | 3121 |
|
3122 | 3122 | class TestWeek(Base):
|
3123 |
| - _offset = Week |
| 3123 | + _offset = Week # type: Callable |
3124 | 3124 | d = Timestamp(datetime(2008, 1, 2))
|
3125 | 3125 | offset1 = _offset()
|
3126 | 3126 | offset2 = _offset(2)
|
@@ -3219,7 +3219,7 @@ def test_onOffset(self, weekday):
|
3219 | 3219 |
|
3220 | 3220 |
|
3221 | 3221 | class TestWeekOfMonth(Base):
|
3222 |
| - _offset = WeekOfMonth |
| 3222 | + _offset = WeekOfMonth # type: Callable |
3223 | 3223 | offset1 = _offset()
|
3224 | 3224 | offset2 = _offset(2)
|
3225 | 3225 |
|
@@ -3319,7 +3319,7 @@ def test_onOffset(self, case):
|
3319 | 3319 |
|
3320 | 3320 |
|
3321 | 3321 | class TestLastWeekOfMonth(Base):
|
3322 |
| - _offset = LastWeekOfMonth |
| 3322 | + _offset = LastWeekOfMonth # type: Callable |
3323 | 3323 | offset1 = _offset()
|
3324 | 3324 | offset2 = _offset(2)
|
3325 | 3325 |
|
@@ -3396,7 +3396,7 @@ def test_onOffset(self, case):
|
3396 | 3396 |
|
3397 | 3397 |
|
3398 | 3398 | class TestSemiMonthEnd(Base):
|
3399 |
| - _offset = SemiMonthEnd |
| 3399 | + _offset = SemiMonthEnd # type: Callable |
3400 | 3400 | offset1 = _offset()
|
3401 | 3401 | offset2 = _offset(2)
|
3402 | 3402 |
|
@@ -3655,7 +3655,7 @@ def test_vectorized_offset_addition(self, klass):
|
3655 | 3655 |
|
3656 | 3656 |
|
3657 | 3657 | class TestSemiMonthBegin(Base):
|
3658 |
| - _offset = SemiMonthBegin |
| 3658 | + _offset = SemiMonthBegin # type: Callable |
3659 | 3659 | offset1 = _offset()
|
3660 | 3660 | offset2 = _offset(2)
|
3661 | 3661 |
|
|
0 commit comments