15
15
from databento .common .parsing import optional_datetime_to_string
16
16
from databento .common .parsing import optional_symbols_list_to_list
17
17
from databento .common .validation import validate_enum
18
+ from databento .common .validation import validate_file_write_path
18
19
from databento .common .validation import validate_semantic_string
19
20
from databento .historical .api import API_VERSION
20
21
from databento .historical .http import BentoHttpAPI
@@ -79,7 +80,7 @@ def get_range(
79
80
limit : int, optional
80
81
The maximum number of records to return. If `None` then no limit.
81
82
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`).
83
84
84
85
Returns
85
86
-------
@@ -102,7 +103,6 @@ def get_range(
102
103
data : dict [str , object | None ] = {
103
104
"dataset" : validate_semantic_string (dataset , "dataset" ),
104
105
"start" : start_valid ,
105
- "end" : end_valid ,
106
106
"symbols" : "," .join (symbols_list ),
107
107
"schema" : str (schema_valid ),
108
108
"stype_in" : str (stype_in_valid ),
@@ -114,6 +114,10 @@ def get_range(
114
114
# Optional Parameters
115
115
if limit is not None :
116
116
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" )
117
121
118
122
return self ._stream (
119
123
url = self ._base_url + ".get_range" ,
@@ -173,7 +177,7 @@ async def get_range_async(
173
177
limit : int, optional
174
178
The maximum number of records to return. If `None` then no limit.
175
179
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`).
177
181
178
182
Returns
179
183
-------
@@ -196,7 +200,6 @@ async def get_range_async(
196
200
data : dict [str , object | None ] = {
197
201
"dataset" : validate_semantic_string (dataset , "dataset" ),
198
202
"start" : start_valid ,
199
- "end" : end_valid ,
200
203
"symbols" : "," .join (symbols_list ),
201
204
"schema" : str (schema_valid ),
202
205
"stype_in" : str (stype_in_valid ),
@@ -208,6 +211,10 @@ async def get_range_async(
208
211
# Optional Parameters
209
212
if limit is not None :
210
213
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" )
211
218
212
219
return await self ._stream_async (
213
220
url = self ._base_url + ".get_range" ,
0 commit comments