A dataset handler that proxies to an underlying filesystem. Useful to partially wrap an existing filesystem with partial changes.
| 246 | |
| 247 | |
| 248 | class ProxyHandler(pyarrow.fs.FileSystemHandler): |
| 249 | """ |
| 250 | A dataset handler that proxies to an underlying filesystem. Useful |
| 251 | to partially wrap an existing filesystem with partial changes. |
| 252 | """ |
| 253 | |
| 254 | def __init__(self, fs): |
| 255 | self._fs = fs |
| 256 | |
| 257 | def __eq__(self, other): |
| 258 | if isinstance(other, ProxyHandler): |
| 259 | return self._fs == other._fs |
| 260 | return NotImplemented |
| 261 | |
| 262 | def __ne__(self, other): |
| 263 | if isinstance(other, ProxyHandler): |
| 264 | return self._fs != other._fs |
| 265 | return NotImplemented |
| 266 | |
| 267 | def get_type_name(self): |
| 268 | return "proxy::" + self._fs.type_name |
| 269 | |
| 270 | def normalize_path(self, path): |
| 271 | return self._fs.normalize_path(path) |
| 272 | |
| 273 | def get_file_info(self, paths): |
| 274 | return self._fs.get_file_info(paths) |
| 275 | |
| 276 | def get_file_info_selector(self, selector): |
| 277 | return self._fs.get_file_info(selector) |
| 278 | |
| 279 | def create_dir(self, path, recursive): |
| 280 | return self._fs.create_dir(path, recursive=recursive) |
| 281 | |
| 282 | def delete_dir(self, path): |
| 283 | return self._fs.delete_dir(path) |
| 284 | |
| 285 | def delete_dir_contents(self, path, missing_dir_ok): |
| 286 | return self._fs.delete_dir_contents(path, |
| 287 | missing_dir_ok=missing_dir_ok) |
| 288 | |
| 289 | def delete_root_dir_contents(self): |
| 290 | return self._fs.delete_dir_contents("", accept_root_dir=True) |
| 291 | |
| 292 | def delete_file(self, path): |
| 293 | return self._fs.delete_file(path) |
| 294 | |
| 295 | def move(self, src, dest): |
| 296 | return self._fs.move(src, dest) |
| 297 | |
| 298 | def copy_file(self, src, dest): |
| 299 | return self._fs.copy_file(src, dest) |
| 300 | |
| 301 | def open_input_stream(self, path): |
| 302 | return self._fs.open_input_stream(path) |
| 303 | |
| 304 | def open_input_file(self, path): |
| 305 | return self._fs.open_input_file(path) |
no outgoing calls