2
2
For cython types that cannot be represented precisely, closest-available
3
3
python equivalents are used, and the precise types kept as adjacent comments.
4
4
"""
5
+ from __future__ import annotations
6
+
5
7
from datetime import tzinfo
6
- from typing import (
7
- Optional ,
8
- Union ,
9
- )
10
8
11
9
import numpy as np
12
10
@@ -16,32 +14,24 @@ from pandas._libs.tslibs.offsets import BaseOffset
16
14
def dt64arr_to_periodarr (
17
15
stamps : np .ndarray , # const int64_t[:]
18
16
freq : int ,
19
- tz : Optional [ tzinfo ] ,
17
+ tz : tzinfo | None ,
20
18
) -> np .ndarray : ... # np.ndarray[np.int64, ndim=1]
21
-
22
-
23
19
def is_date_array_normalized (
24
20
stamps : np .ndarray , # const int64_t[:]
25
- tz : Optional [ tzinfo ] = None ,
21
+ tz : tzinfo | None = None ,
26
22
) -> bool : ...
27
-
28
-
29
23
def normalize_i8_timestamps (
30
24
stamps : np .ndarray , # const int64_t[:]
31
- tz : Optional [ tzinfo ] ,
25
+ tz : tzinfo | None ,
32
26
) -> np .ndarray : ... # np.ndarray[np.int64]
33
-
34
-
35
27
def get_resolution (
36
28
stamps : np .ndarray , # const int64_t[:]
37
- tz : Optional [ tzinfo ] = None ,
29
+ tz : tzinfo | None = None ,
38
30
) -> Resolution : ...
39
-
40
-
41
31
def ints_to_pydatetime (
42
32
arr : np .ndarray , # const int64_t[:}]
43
- tz : Optional [ tzinfo ] = None ,
44
- freq : Optional [ Union [ str , BaseOffset ]] = None ,
33
+ tz : tzinfo | None = None ,
34
+ freq : str | BaseOffset | None = None ,
45
35
fold : bool = False ,
46
36
box : str = "datetime" ,
47
37
) -> np .ndarray : ... # np.ndarray[object]
0 commit comments