Skip to content

Commit b94e580

Browse files
committed
MOD: Remove encoding param from get_record_count
1 parent d361fbb commit b94e580

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
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[Any]] = None
32+
self._dtype: Optional[np.dtype] = None # type: ignore
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[Any]:
160+
def dtype(self) -> np.dtype: # type: ignore
161161
"""
162162
Return the binary struct format for the data schema.
163163
164164
Returns
165165
-------
166-
np.dtype[Any]
166+
np.dtype
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[Any, Any]:
406+
def to_ndarray(self) -> np.ndarray: # type: ignore
407407
"""
408408
Return the data as a numpy `ndarray`.
409409
410410
Returns
411411
-------
412-
np.ndarray[Any, Any]
412+
np.ndarray
413413
414414
"""
415415
data: bytes = self.reader(decompress=True).read()

databento/historical/api/metadata.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ def get_record_count(
288288
end: Union[pd.Timestamp, date, str, int],
289289
symbols: Optional[Union[List[str], str]] = None,
290290
schema: Union[Schema, str] = "trades",
291-
encoding: Union[Encoding, str] = "dbn",
292291
stype_in: Optional[Union[SType, str]] = "native",
293292
limit: Optional[int] = None,
294293
) -> int:
@@ -312,8 +311,6 @@ def get_record_count(
312311
If `*` or ``None`` then will be for **all** symbols.
313312
schema : Schema or str {'mbo', 'mbp-1', 'mbp-10', 'trades', 'tbbo', 'ohlcv-1s', 'ohlcv-1m', 'ohlcv-1h', 'ohlcv-1d', 'definition', 'statistics', 'status'}, default 'trades' # noqa
314313
The data record schema for the request.
315-
encoding : Encoding or str {'dbn', 'csv', 'json'}, optional
316-
The data encoding.
317314
stype_in : SType or str, default 'native'
318315
The input symbology type to resolve from.
319316
limit : int, optional
@@ -335,7 +332,6 @@ def get_record_count(
335332
("schema", Schema(schema).value),
336333
("start", maybe_datetime_to_string(start)),
337334
("end", maybe_datetime_to_string(end)),
338-
("encoding", Encoding(encoding).value),
339335
("stype_in", SType(stype_in).value),
340336
]
341337
if limit is not None:

examples/historical_metadata_get_record_count.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
schema="mbo",
1414
start="2022-06-10T12:00",
1515
end="2022-06-10T14:00",
16-
encoding="csv",
1716
)
1817

1918
print(count)

tests/test_historical_metadata.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ def test_get_record_count_sends_expected_request(
281281
("schema", "mbo"),
282282
("start", "2020-12-28T12:00:00"),
283283
("end", "2020-12-29T00:00:00"),
284-
("encoding", "dbn"),
285284
("stype_in", "native"),
286285
("limit", "1000000"),
287286
]

0 commit comments

Comments
 (0)