Skip to content

Commit d361fbb

Browse files
committed
BLD: Remove mypy from pre-commit
1 parent 721d31d commit d361fbb

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

databento/common/bento.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Bento:
2929

3030
def __init__(self) -> None:
3131
self._metadata: Dict[str, Any] = {}
32-
self._dtype: Optional[np.dtype] = None
32+
self._dtype: Optional[np.dtype[Any]] = None
3333
self._product_id_index: Dict[dt.date, Dict[int, str]] = {}
3434

3535
self._dataset: Optional[str] = None
@@ -157,13 +157,13 @@ def raw(self) -> bytes:
157157
raise NotImplementedError() # pragma: no cover
158158

159159
@property
160-
def dtype(self) -> np.dtype:
160+
def dtype(self) -> np.dtype[Any]:
161161
"""
162162
Return the binary struct format for the data schema.
163163
164164
Returns
165165
-------
166-
np.dtype
166+
np.dtype[Any]
167167
168168
"""
169169
if self._dtype is None:
@@ -403,13 +403,13 @@ def symbology(self) -> Dict[str, Any]:
403403

404404
return symbology
405405

406-
def to_ndarray(self) -> np.ndarray:
406+
def to_ndarray(self) -> np.ndarray[Any, Any]:
407407
"""
408408
Return the data as a numpy `ndarray`.
409409
410410
Returns
411411
-------
412-
np.ndarray
412+
np.ndarray[Any, Any]
413413
414414
"""
415415
data: bytes = self.reader(decompress=True).read()

databento/historical/http.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,18 +256,20 @@ def check_http_error(response: Response) -> None:
256256
async def check_http_error_async(response: ClientResponse) -> None:
257257
if is_500_series_error(response.status):
258258
json_body = await response.json()
259+
http_body = await response.read()
259260
raise BentoServerError(
260261
http_status=response.status,
261-
http_body=response.content,
262+
http_body=http_body,
262263
json_body=json_body,
263264
message=json_body["detail"],
264265
headers=response.headers,
265266
)
266267
elif is_400_series_error(response.status):
267268
json_body = await response.json()
269+
http_body = await response.read()
268270
raise BentoClientError(
269271
http_status=response.status,
270-
http_body=response.content,
272+
http_body=http_body,
271273
json_body=json_body,
272274
message=json_body["detail"],
273275
headers=response.headers,

requirements_dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
mypy>=0.991
12
pytest>=7.2.0
23
pytest-mock>=3.10.0
34
types-requests

scripts/lint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#! /usr/bin/env bash
2+
echo $(mypy --version)
3+
echo Running mypy...
4+
mypy databento examples tests --config-file mypy.ini

0 commit comments

Comments
 (0)