Skip to content

Commit 27768a4

Browse files
committed
FIX: Type annotations for os.PathLike in py37
1 parent 963b8ae commit 27768a4

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

databento/common/bento.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import abc
24
import datetime as dt
35
from io import BytesIO
@@ -402,7 +404,7 @@ def dataset(self) -> str:
402404
return str(self._metadata["dataset"])
403405

404406
@property
405-
def dtype(self) -> np.dtype: # type: ignore
407+
def dtype(self) -> np.dtype[Any]:
406408
"""
407409
Return the binary struct format for the data schema.
408410
@@ -873,7 +875,7 @@ def to_json(
873875
map_symbols=map_symbols,
874876
).to_json(path, orient="records", lines=True)
875877

876-
def to_ndarray(self) -> np.ndarray: # type: ignore
878+
def to_ndarray(self) -> np.ndarray[Any, Any]:
877879
"""
878880
Return the data as a numpy `ndarray`.
879881

databento/common/validation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from enum import Enum
24
from os import PathLike
35
from pathlib import Path

databento/historical/api/batch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import os
24
from datetime import date
35
from os import PathLike

databento/historical/api/timeseries.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import warnings
24
from datetime import date
35
from io import BufferedIOBase, BytesIO

0 commit comments

Comments
 (0)