|
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 | ------- |
@@ -115,6 +116,8 @@ def get_range( |
115 | 116 | data["limit"] = str(limit) |
116 | 117 | if end is not None: |
117 | 118 | data["end"] = end_valid |
| 119 | + if path is not None: |
| 120 | + path = validate_file_write_path(path, "path") |
118 | 121 |
|
119 | 122 | return self._stream( |
120 | 123 | url=self._base_url + ".get_range", |
@@ -174,7 +177,7 @@ async def get_range_async( |
174 | 177 | limit : int, optional |
175 | 178 | The maximum number of records to return. If `None` then no limit. |
176 | 179 | path : PathLike or str, optional |
177 | | - 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`). |
178 | 181 |
|
179 | 182 | Returns |
180 | 183 | ------- |
@@ -210,6 +213,8 @@ async def get_range_async( |
210 | 213 | data["limit"] = str(limit) |
211 | 214 | if end is not None: |
212 | 215 | data["end"] = end_valid |
| 216 | + if path is not None: |
| 217 | + path = validate_file_write_path(path, "path") |
213 | 218 |
|
214 | 219 | return await self._stream_async( |
215 | 220 | url=self._base_url + ".get_range", |
|
0 commit comments