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
6 changes: 3 additions & 3 deletions stac_geoparquet/arrow/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def stac_table_to_items(table: pa.Table) -> Iterable[dict]:
"""Convert a STAC Table to a generator of STAC Item `dict`s"""
for batch in table.to_batches():
clean_batch = StacArrowBatch(batch)
yield from clean_batch.to_raw_batch().iter_dicts()
yield from clean_batch.to_json_batch().iter_dicts()


def stac_table_to_ndjson(
Expand All @@ -108,7 +108,7 @@ def stac_table_to_ndjson(
"""Write a STAC Table to a newline-delimited JSON file."""
for batch in table.to_batches():
clean_batch = StacArrowBatch(batch)
clean_batch.to_raw_batch().to_ndjson(dest)
clean_batch.to_json_batch().to_ndjson(dest)


def stac_items_to_arrow(
Expand All @@ -133,4 +133,4 @@ def stac_items_to_arrow(
Arrow RecordBatch with items in Arrow
"""
raw_batch = StacJsonBatch.from_dicts(items, schema=schema)
return raw_batch.to_clean_batch().inner
return raw_batch.to_arrow_batch().inner
4 changes: 2 additions & 2 deletions stac_geoparquet/arrow/_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def iter_dicts(self) -> Iterable[dict]:

yield row_dict

def to_clean_batch(self) -> StacArrowBatch:
def to_arrow_batch(self) -> StacArrowBatch:
batch = self.inner

batch = bring_properties_to_top_level(batch)
Expand Down Expand Up @@ -180,7 +180,7 @@ class StacArrowBatch:
def __init__(self, batch: pa.RecordBatch) -> None:
self.inner = batch

def to_raw_batch(self) -> StacJsonBatch:
def to_json_batch(self) -> StacJsonBatch:
batch = self.inner

batch = convert_timestamp_columns_to_string(batch)
Expand Down