|
1 | | -from typing import TYPE_CHECKING, Any |
| 1 | +from __future__ import annotations |
| 2 | + |
| 3 | +from typing import TYPE_CHECKING |
2 | 4 |
|
3 | 5 | if TYPE_CHECKING: |
4 | | - import pyarrow as pa |
5 | 6 | import pyarrow.fs as fs |
6 | 7 |
|
7 | 8 | class Path: |
8 | 9 | def __init__(self, raw: str | list[str]) -> None: ... |
9 | 10 | def child(self, part: str) -> Path: ... |
10 | 11 |
|
| 12 | +class ObjectMeta: |
| 13 | + """The metadata that describes an object.""" |
| 14 | + |
| 15 | + @property |
| 16 | + def size(self) -> int: |
| 17 | + """The size in bytes of the object""" |
| 18 | + @property |
| 19 | + def location(self) -> Path: |
| 20 | + """The full path to the object""" |
| 21 | + @property |
| 22 | + def last_modified(self) -> int: |
| 23 | + """The last modified time""" |
| 24 | + |
| 25 | +class ListResult: |
| 26 | + """Result of a list call that includes objects and prefixes (directories)""" |
| 27 | + |
| 28 | + @property |
| 29 | + def common_prefixes(self) -> list[Path]: |
| 30 | + """Prefixes that are common (like directories)""" |
| 31 | + @property |
| 32 | + def objects(self) -> list[ObjectMeta]: |
| 33 | + """Object metadata for the listing""" |
| 34 | + |
11 | 35 | class ObjectStore: |
12 | 36 | """A uniform API for interacting with object storage services and local files.""" |
13 | 37 |
|
@@ -139,26 +163,3 @@ class ArrowFileSystemHandler: |
139 | 163 | """Open an input file for random access reading.""" |
140 | 164 | def open_output_stream(self, path: str, metadata: dict[str, str] | None = None) -> ObjectOutputStream: |
141 | 165 | """Open an output stream for sequential writing.""" |
142 | | - |
143 | | -class ObjectMeta: |
144 | | - """The metadata that describes an object.""" |
145 | | - |
146 | | - @property |
147 | | - def size(self) -> int: |
148 | | - """The size in bytes of the object""" |
149 | | - @property |
150 | | - def location(self) -> Path: |
151 | | - """The full path to the object""" |
152 | | - @property |
153 | | - def last_modified(self) -> int: |
154 | | - """The last modified time""" |
155 | | - |
156 | | -class ListResult: |
157 | | - """Result of a list call that includes objects and prefixes (directories)""" |
158 | | - |
159 | | - @property |
160 | | - def common_prefixes(self) -> list[Path]: |
161 | | - """Prefixes that are common (like directories)""" |
162 | | - @property |
163 | | - def objects(self) -> list[ObjectMeta]: |
164 | | - """Object metadata for the listing""" |
|
0 commit comments