1515from databento .common .parsing import optional_datetime_to_string
1616from databento .common .parsing import optional_symbols_list_to_list
1717from databento .common .validation import validate_enum
18+ from databento .common .validation import validate_file_write_path
1819from databento .common .validation import validate_semantic_string
1920from databento .historical .api import API_VERSION
2021from databento .historical .http import BentoHttpAPI
@@ -79,7 +80,7 @@ def get_range(
7980 limit : int, optional
8081 The maximum number of records to return. If `None` then no limit.
8182 path : PathLike or str, optional
82- The path to stream the data to on disk (will then return a `DBNStore`).
83+ The file path to stream the data to on disk (will then return a `DBNStore`).
8384
8485 Returns
8586 -------
@@ -102,7 +103,6 @@ def get_range(
102103 data : dict [str , object | None ] = {
103104 "dataset" : validate_semantic_string (dataset , "dataset" ),
104105 "start" : start_valid ,
105- "end" : end_valid ,
106106 "symbols" : "," .join (symbols_list ),
107107 "schema" : str (schema_valid ),
108108 "stype_in" : str (stype_in_valid ),
@@ -114,6 +114,10 @@ def get_range(
114114 # Optional Parameters
115115 if limit is not None :
116116 data ["limit" ] = str (limit )
117+ if end is not None :
118+ data ["end" ] = end_valid
119+ if path is not None :
120+ path = validate_file_write_path (path , "path" )
117121
118122 return self ._stream (
119123 url = self ._base_url + ".get_range" ,
@@ -173,7 +177,7 @@ async def get_range_async(
173177 limit : int, optional
174178 The maximum number of records to return. If `None` then no limit.
175179 path : PathLike or str, optional
176- The path to stream the data to on disk (will then return a `DBNStore`).
180+ The file path to stream the data to on disk (will then return a `DBNStore`).
177181
178182 Returns
179183 -------
@@ -196,7 +200,6 @@ async def get_range_async(
196200 data : dict [str , object | None ] = {
197201 "dataset" : validate_semantic_string (dataset , "dataset" ),
198202 "start" : start_valid ,
199- "end" : end_valid ,
200203 "symbols" : "," .join (symbols_list ),
201204 "schema" : str (schema_valid ),
202205 "stype_in" : str (stype_in_valid ),
@@ -208,6 +211,10 @@ async def get_range_async(
208211 # Optional Parameters
209212 if limit is not None :
210213 data ["limit" ] = str (limit )
214+ if end is not None :
215+ data ["end" ] = end_valid
216+ if path is not None :
217+ path = validate_file_write_path (path , "path" )
211218
212219 return await self ._stream_async (
213220 url = self ._base_url + ".get_range" ,
0 commit comments