From bedc763d0aa92c4682fcbbedd734135dea8ae982 Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Tue, 4 Jun 2024 14:40:46 -0400 Subject: [PATCH] Rename raw/clean batch to json/arrow batch --- stac_geoparquet/arrow/_api.py | 6 +++--- stac_geoparquet/arrow/_batch.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stac_geoparquet/arrow/_api.py b/stac_geoparquet/arrow/_api.py index 2fee475..7d70a55 100644 --- a/stac_geoparquet/arrow/_api.py +++ b/stac_geoparquet/arrow/_api.py @@ -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( @@ -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( @@ -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 diff --git a/stac_geoparquet/arrow/_batch.py b/stac_geoparquet/arrow/_batch.py index 7130cb2..5313542 100644 --- a/stac_geoparquet/arrow/_batch.py +++ b/stac_geoparquet/arrow/_batch.py @@ -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) @@ -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)