Skip to content

Commit 05a096b

Browse files
committed
FIX: Fix get_dataset_condition param handling
1 parent 60920c7 commit 05a096b

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

databento/historical/api/metadata.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import pandas as pd
55
from databento.common.enums import Dataset, Encoding, FeedMode, Schema, SType
66
from databento.common.parsing import (
7-
datetime_to_date_string,
87
datetime_to_string,
98
optional_date_to_string,
109
optional_datetime_to_string,
@@ -270,8 +269,8 @@ def get_dataset_condition(
270269
"""
271270
params: List[Tuple[str, Optional[str]]] = [
272271
("dataset", dataset),
273-
("start_date", datetime_to_date_string(start_date)),
274-
("end_date", datetime_to_date_string(end_date)),
272+
("start_date", optional_date_to_string(start_date)),
273+
("end_date", optional_date_to_string(end_date)),
275274
]
276275

277276
response: Response = self._get(
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from pprint import pprint
2+
3+
import databento as db
4+
5+
6+
if __name__ == "__main__":
7+
db.log = "debug" # Optional debug logging
8+
9+
key = "YOUR_API_KEY"
10+
client = db.Historical(key=key)
11+
12+
condition = client.metadata.get_dataset_condition(dataset="XNAS.ITCH")
13+
14+
pprint(condition)

0 commit comments

Comments
 (0)