Skip to content

Commit 26cf26d

Browse files
committed
MOD: Apply standardizations and fix mypy warnings
1 parent 940d9ad commit 26cf26d

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

databento/common/bento.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self) -> None:
3535
self._limit: Optional[int] = None
3636
self._encoding: Optional[Encoding] = None
3737
self._compression: Optional[Compression] = None
38-
self._shape: Optional[Tuple] = None
38+
self._shape: Optional[Tuple[int, ...]] = None
3939

4040
def _check_metadata(self) -> None:
4141
if not self._metadata:
@@ -340,13 +340,13 @@ def compression(self) -> Compression:
340340
return self._compression
341341

342342
@property
343-
def shape(self) -> Tuple:
343+
def shape(self) -> Tuple[int, ...]:
344344
"""
345345
Return the shape of the data.
346346
347347
Returns
348348
-------
349-
Tuple
349+
Tuple[int, ...]
350350
The data shape.
351351
352352
"""

databento/historical/api/metadata.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def list_fields(
124124
dataset: Union[Dataset, str],
125125
schema: Optional[Union[Schema, str]] = None,
126126
encoding: Optional[Union[Encoding, str]] = None,
127-
) -> Dict[str, Dict]:
127+
) -> Dict[str, Dict[str, str]]:
128128
"""
129129
Request all fields for a dataset, schema and encoding from Databento.
130130
@@ -144,7 +144,7 @@ def list_fields(
144144
145145
Returns
146146
-------
147-
Dict[str, Any]
147+
Dict[str, Dict[str, str]]
148148
A mapping of dataset to encoding to schema to field to data type.
149149
150150
"""
@@ -251,7 +251,7 @@ def get_shape(
251251
encoding: Union[Encoding, str] = "dbz",
252252
stype_in: Optional[Union[SType, str]] = "native",
253253
limit: Optional[int] = None,
254-
) -> Tuple:
254+
) -> Tuple[int, ...]:
255255
"""
256256
Request the shape of the time series data from Databento.
257257
@@ -282,7 +282,7 @@ def get_shape(
282282
283283
Returns
284284
-------
285-
Tuple
285+
Tuple[int, ...]
286286
The shape of the data expressed as size per dimension.
287287
288288
"""
@@ -307,7 +307,7 @@ def get_shape(
307307
basic_auth=True,
308308
)
309309

310-
values = response.json()
310+
values: List[int] = response.json()
311311
return tuple(values)
312312

313313
def get_billable_size(

examples/historical_metadata_get_shape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
key = "YOUR_API_KEY"
1010
client = db.Historical(key=key)
1111

12-
shape: Tuple = client.metadata.get_shape(
12+
shape: Tuple[int, ...] = client.metadata.get_shape(
1313
dataset="GLBX.MDP3",
1414
symbols=["ESM2"],
1515
schema="mbo",

0 commit comments

Comments
 (0)