1111from databento .common .deprecated import deprecated
1212from databento .common .enums import Compression , Dataset , Encoding , Schema , SType
1313from databento .common .error import BentoWarning
14- from databento .common .parsing import datetime_to_string , optional_symbols_list_to_string
14+ from databento .common .parsing import (
15+ datetime_to_string ,
16+ optional_datetime_to_string ,
17+ optional_symbols_list_to_string ,
18+ )
1519from databento .common .validation import validate_enum , validate_semantic_string
1620from databento .historical .api import API_VERSION
1721from databento .historical .http import BentoHttpAPI
@@ -31,7 +35,7 @@ def stream(
3135 self ,
3236 dataset : Union [Dataset , str ],
3337 start : Union [pd .Timestamp , date , str , int ],
34- end : Union [pd .Timestamp , date , str , int ],
38+ end : Optional [ Union [pd .Timestamp , date , str , int ]] = None ,
3539 symbols : Optional [Union [List [str ], str ]] = None ,
3640 schema : Union [Schema , str ] = "trades" ,
3741 stype_in : Union [SType , str ] = "native" ,
@@ -59,7 +63,7 @@ def get_range(
5963 self ,
6064 dataset : Union [Dataset , str ],
6165 start : Union [pd .Timestamp , date , str , int ],
62- end : Union [pd .Timestamp , date , str , int ],
66+ end : Optional [ Union [pd .Timestamp , date , str , int ]] = None ,
6367 symbols : Optional [Union [List [str ], str ]] = None ,
6468 schema : Union [Schema , str ] = "trades" ,
6569 stype_in : Union [SType , str ] = "native" ,
@@ -83,11 +87,15 @@ def get_range(
8387 dataset : Dataset or str
8488 The dataset code (string identifier) for the request.
8589 start : pd.Timestamp or date or str or int
86- The start datetime (UTC) of the request time range (inclusive).
90+ The start datetime of the request time range (inclusive).
91+ Assumes UTC as timezone unless passed a tz-aware object.
8792 If an integer is passed, then this represents nanoseconds since the UNIX epoch.
88- end : pd.Timestamp or date or str or int
89- The end datetime (UTC) of the request time range (exclusive).
93+ end : pd.Timestamp or date or str or int, optional
94+ The end datetime of the request time range (exclusive).
95+ Assumes UTC as timezone unless passed a tz-aware object.
9096 If an integer is passed, then this represents nanoseconds since the UNIX epoch.
97+ Values are forward filled based on the resolution provided.
98+ Defaults to the same value as `start`.
9199 symbols : List[Union[str, int]] or str, optional
92100 The product symbols to filter for. Takes up to 2,000 symbols per request.
93101 If more than 1 symbol is specified, the data is merged and sorted by time.
@@ -122,7 +130,7 @@ def get_range(
122130 params : List [Tuple [str , Optional [str ]]] = [
123131 ("dataset" , validate_semantic_string (dataset , "dataset" )),
124132 ("start" , datetime_to_string (start )),
125- ("end" , datetime_to_string (end )),
133+ ("end" , optional_datetime_to_string (end )),
126134 ("symbols" , symbols_list ),
127135 ("schema" , str (schema_valid )),
128136 ("stype_in" , str (stype_in_valid )),
@@ -166,7 +174,7 @@ async def stream_async(
166174 self ,
167175 dataset : Union [Dataset , str ],
168176 start : Union [pd .Timestamp , date , str , int ],
169- end : Union [pd .Timestamp , date , str , int ],
177+ end : Optional [ Union [pd .Timestamp , date , str , int ]] = None ,
170178 symbols : Optional [Union [List [str ], str ]] = None ,
171179 schema : Union [Schema , str ] = "trades" ,
172180 stype_in : Union [SType , str ] = "native" ,
@@ -195,7 +203,7 @@ async def get_range_async(
195203 self ,
196204 dataset : Union [Dataset , str ],
197205 start : Union [pd .Timestamp , date , str , int ],
198- end : Union [pd .Timestamp , date , str , int ],
206+ end : Optional [ Union [pd .Timestamp , date , str , int ]] = None ,
199207 symbols : Optional [Union [List [str ], str ]] = None ,
200208 schema : Union [Schema , str ] = "trades" ,
201209 stype_in : Union [SType , str ] = "native" ,
@@ -219,11 +227,15 @@ async def get_range_async(
219227 dataset : Dataset or str
220228 The dataset code (string identifier) for the request.
221229 start : pd.Timestamp or date or str or int
222- The start datetime (UTC) of the request time range (inclusive).
230+ The start datetime of the request time range (inclusive).
231+ Assumes UTC as timezone unless passed a tz-aware object.
223232 If an integer is passed, then this represents nanoseconds since the UNIX epoch.
224- end : pd.Timestamp or date or str or int
225- The end datetime (UTC) of the request time range (exclusive).
233+ end : pd.Timestamp or date or str or int, optional
234+ The end datetime of the request time range (exclusive).
235+ Assumes UTC as timezone unless passed a tz-aware object.
226236 If an integer is passed, then this represents nanoseconds since the UNIX epoch.
237+ Values are forward filled based on the resolution provided.
238+ Defaults to the same value as `start`.
227239 symbols : List[Union[str, int]] or str, optional
228240 The product symbols to filter for. Takes up to 2,000 symbols per request.
229241 If more than 1 symbol is specified, the data is merged and sorted by time.
@@ -258,7 +270,7 @@ async def get_range_async(
258270 params : List [Tuple [str , Optional [str ]]] = [
259271 ("dataset" , validate_semantic_string (dataset , "dataset" )),
260272 ("start" , datetime_to_string (start )),
261- ("end" , datetime_to_string (end )),
273+ ("end" , optional_datetime_to_string (end )),
262274 ("symbols" , symbols_list ),
263275 ("schema" , str (schema_valid )),
264276 ("stype_in" , str (stype_in_valid )),
0 commit comments