Skip to content

Commit be985a6

Browse files
authored
fix: include type field in geoparquet write (#136)
cc @hrodmn
1 parent 7903f56 commit be985a6

File tree

5 files changed

+88
-46
lines changed

5 files changed

+88
-46
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55

66
## [Unreleased]
77

8+
### Added
9+
10+
- `type` field to geoparquet writes ([#136](https://github.com/stac-utils/rustac-py/pull/136), <https://github.com/stac-utils/rustac/pull/736>)
11+
812
## [0.8.0] - 2025-05-13
913

1014
### Added

Cargo.lock

Lines changed: 48 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ dev = [
5858
"maturin>=1.7.4",
5959
"maturin-import-hook>=0.2.0",
6060
"mypy>=1.11.2",
61+
"pandas>=2.2.3",
62+
"pandas-stubs>=2.2.3.250308",
6163
"pyarrow>=19.0.1",
6264
"pystac[validation]>=1.11.0",
6365
"pytest>=8.3.3",

tests/test_write.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from pathlib import Path
22
from typing import Any
33

4+
import pandas
45
import pyarrow.parquet
56
import rustac
67
import stac_geoparquet
@@ -27,3 +28,10 @@ async def test_write_store(item: dict[str, Any], tmp_path: Path) -> None:
2728
await rustac.write("item.json", item, store=store)
2829
read_item = await rustac.read("item.json", store=store)
2930
assert item["id"] == read_item["id"]
31+
32+
33+
async def test_write_includes_type(tmp_path: Path, item: dict[str, Any]) -> None:
34+
assert "type" in item
35+
await rustac.write(str(tmp_path / "out.parquet"), [item])
36+
data_frame = pandas.read_parquet(str(tmp_path / "out.parquet"))
37+
assert "type" in data_frame.columns

0 commit comments

Comments
 (0)