Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Fixes #17

Merged
merged 2 commits into from
Jul 18, 2023
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
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ pc = [
test = [
"pytest",
"requests",
"pre-commit"
"pre-commit",
"stac-geoparquet[pgstac]",
"stac-geoparquet[pc]",
]


Expand Down
2 changes: 1 addition & 1 deletion stac_geoparquet/stac_geoparquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def to_geodataframe(items: Sequence[dict[str, Any]]) -> geopandas.GeoDataFrame:
for col in opt_columns:
if col not in gdf.columns:
columns.remove(col)

gdf = pd.concat([gdf[columns], gdf.drop(columns=columns)], axis="columns")
for k in ["type", "stac_version", "id", "collection"]:
if k in gdf:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pgstac_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ def test_generate_endpoints():
)
endpoints = cfg.generate_endpoints()
assert endpoints[0][0] == pd.Timestamp("2010-01-01 00:00:00+0000", tz="utc")
assert endpoints[-1][1] == pd.Timestamp("2021-01-01 00:00:00+0000", tz="utc")
assert endpoints[-1][1] >= pd.Timestamp("2021-01-01 00:00:00+0000", tz="utc")

endpoints = cfg.generate_endpoints(since=pd.Timestamp("2018-01-01", tz="utc"))
assert endpoints[0][0] == pd.Timestamp("2018-01-01 00:00:00+0000", tz="utc")
assert endpoints[-1][1] == pd.Timestamp("2021-01-01 00:00:00+0000", tz="utc")
assert endpoints[-1][1] >= pd.Timestamp("2021-01-01 00:00:00+0000", tz="utc")


@pytest.mark.parametrize(
Expand Down
6 changes: 4 additions & 2 deletions tests/test_stac_geoparquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,10 @@ def test_s1_grd():
# pystac migrates EO extension to latest version, but PC is still on 1.0.0
for i, ext in enumerate(item["stac_extensions"]):
if ext == "https://stac-extensions.github.io/eo/v1.0.0/schema.json":
item["stac_extensions"][i] = "https://stac-extensions.github.io/eo/v1.1.0/schema.json"

item["stac_extensions"][
i
] = "https://stac-extensions.github.io/eo/v1.1.0/schema.json"

item["geometry"] = fix_empty_multipolygon(item["geometry"]).__geo_interface__
df = stac_geoparquet.to_geodataframe([item])

Expand Down