|
7 | 7 | Sequence, |
8 | 8 | ) |
9 | 9 | from datetime import ( |
| 10 | + date, |
10 | 11 | datetime, |
11 | 12 | timedelta, |
12 | 13 | tzinfo, |
|
68 | 69 | from pandas.core.window.rolling import BaseWindow |
69 | 70 |
|
70 | 71 | from pandas.io.formats.format import EngFormatter |
| 72 | + from pandas.tseries.holiday import AbstractHolidayCalendar |
71 | 73 |
|
72 | 74 | ScalarLike_co = Union[ |
73 | 75 | int, |
|
89 | 91 | from typing_extensions import TypeGuard # pyright: ignore[reportUnusedImport] |
90 | 92 |
|
91 | 93 | if sys.version_info >= (3, 11): |
92 | | - from typing import Self |
| 94 | + from typing import Self # pyright: ignore[reportUnusedImport] |
93 | 95 | else: |
94 | 96 | from typing_extensions import Self # pyright: ignore[reportUnusedImport] |
95 | 97 | else: |
|
117 | 119 | PythonScalar = Union[str, float, bool] |
118 | 120 | DatetimeLikeScalar = Union["Period", "Timestamp", "Timedelta"] |
119 | 121 | PandasScalar = Union["Period", "Timestamp", "Timedelta", "Interval"] |
120 | | -Scalar = Union[PythonScalar, PandasScalar, np.datetime64, np.timedelta64, datetime] |
| 122 | +Scalar = Union[PythonScalar, PandasScalar, np.datetime64, np.timedelta64, date] |
121 | 123 | IntStrT = TypeVar("IntStrT", int, str) |
122 | 124 |
|
123 | 125 |
|
124 | 126 | # timestamp and timedelta convertible types |
125 | 127 |
|
126 | 128 | TimestampConvertibleTypes = Union[ |
127 | | - "Timestamp", datetime, np.datetime64, np.int64, float, str |
| 129 | + "Timestamp", date, np.datetime64, np.int64, float, str |
| 130 | +] |
| 131 | +TimestampNonexistent = Union[ |
| 132 | + Literal["shift_forward", "shift_backward", "NaT", "raise"], timedelta |
128 | 133 | ] |
129 | 134 | TimedeltaConvertibleTypes = Union[ |
130 | 135 | "Timedelta", timedelta, np.timedelta64, np.int64, float, str |
@@ -466,3 +471,6 @@ def closed(self) -> bool: |
466 | 471 |
|
467 | 472 | # ExcelWriter |
468 | 473 | ExcelWriterIfSheetExists = Literal["error", "new", "replace", "overlay"] |
| 474 | + |
| 475 | +# Offsets |
| 476 | +OffsetCalendar = Union[np.busdaycalendar, "AbstractHolidayCalendar"] |
0 commit comments