Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ plugins:
- https://azuresdkdocs.z19.web.core.windows.net/python/azure-identity/latest/objects.inv
- https://boto3.amazonaws.com/v1/documentation/api/latest/objects.inv
- https://botocore.amazonaws.com/v1/documentation/api/latest/objects.inv
- https://developmentseed.org/obspec/latest/objects.inv
- https://docs.aiohttp.org/en/stable/objects.inv
- https://docs.pola.rs/api/python/stable/objects.inv
- https://docs.python.org/3/objects.inv
Expand Down
14 changes: 14 additions & 0 deletions obstore/python/obstore/_get.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,20 @@ class GetResult:
memory by passing to [`bytes`][].
"""

def buffer(self) -> Bytes:
"""Collect the data into a `Bytes` object.

This is an alias of the [`bytes()`][obstore.GetResult.bytes] method to comply
with the [`obspec.Get`][] protocol.
"""

async def buffer_async(self) -> Bytes:
"""Collect the data into a `Bytes` object.

This is an alias of the [`bytes_async()`][obstore.GetResult.bytes_async] method
to comply with the [`obspec.GetAsync`][] protocol.
"""

@property
def meta(self) -> ObjectMeta:
"""The ObjectMeta for this object."""
Expand Down
8 changes: 8 additions & 0 deletions obstore/src/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ impl PyGetResult {
})
}

fn buffer(&self, py: Python) -> PyObjectStoreResult<PyBytes> {
self.bytes(py)
}

fn buffer_async<'py>(&'py self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> {
self.bytes_async(py)
}

#[getter]
fn attributes(&self) -> PyResult<PyAttributes> {
Ok(PyAttributes::new(self.attributes.clone()))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dev-dependencies = [
"mkdocstrings>=0.27.0",
"moto[s3,server]>=5.1.1",
"mypy>=1.15.0",
"obspec>=0.1.0b6",
"obspec>=0.1.0",
"pip>=24.2",
"polars>=1.30.0",
"pyarrow>=17.0.0",
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading