diff --git a/src/geopins/drivers/gdf/filetypes/gpkg.py b/src/geopins/drivers/gdf/filetypes/gpkg.py index 5ef9d55..b4416eb 100644 --- a/src/geopins/drivers/gdf/filetypes/gpkg.py +++ b/src/geopins/drivers/gdf/filetypes/gpkg.py @@ -83,10 +83,10 @@ def pin_write_gdf_gpkg( # noqa: PLR0913 versioned: Whether the pin should be versioned. Defaults to versioning. created: A date to store in the Meta.created field. This field may be used as part of the pin version name. - force_identical_write: Store the pin even if the pin contents are identical - to the last version (compared using the hash). Only - the pin contents are compared, not the pin metadata. - Defaults to False. + force_identical_write: Not supported. Store the pin even if the pin contents + are identical to the last version (compared using + the hash). Only the pin contents are compared, not + the pin metadata. Defaults to False. board: The (geo)pins board to write to. Returns: diff --git a/src/geopins/drivers/gdf/filetypes/parquet.py b/src/geopins/drivers/gdf/filetypes/parquet.py index b4d83fb..cd0eaf1 100644 --- a/src/geopins/drivers/gdf/filetypes/parquet.py +++ b/src/geopins/drivers/gdf/filetypes/parquet.py @@ -81,10 +81,10 @@ def pin_write_gdf_parquet( # noqa: PLR0913 versioned: Whether the pin should be versioned. Defaults to versioning. created: A date to store in the Meta.created field. This field may be used as part of the pin version name. - force_identical_write: Store the pin even if the pin contents are identical - to the last version (compared using the hash). Only - the pin contents are compared, not the pin metadata. - Defaults to False. + force_identical_write: Not supported. Store the pin even if the pin contents + are identical to the last version (compared using + the hash). Only the pin contents are compared, not + the pin metadata. Defaults to False. board: The (geo)pins board to write to. Returns: diff --git a/tests/geopins/drivers/gdf/filetypes/test_gpkg.py b/tests/geopins/drivers/gdf/filetypes/test_gpkg.py index 2a5b13d..a06b055 100644 --- a/tests/geopins/drivers/gdf/filetypes/test_gpkg.py +++ b/tests/geopins/drivers/gdf/filetypes/test_gpkg.py @@ -4,6 +4,7 @@ from typing import TYPE_CHECKING import geopandas as gpd +import pytest from pins.meta import Meta from geopins.boards import GeoBaseBoard @@ -45,3 +46,18 @@ def test_hash_is_not_dependent_on_file_write_time(tmp_geoboard: GeoBaseBoard): # Assert assert meta1.pin_hash == meta2.pin_hash + + +def test_force_identical_write_raises(tmp_geoboard: GeoBaseBoard): + # Arrange + gdf = gpd.GeoDataFrame( + {"id": [1, 2, 3]}, + geometry=gpd.points_from_xy([0, 1, 2], [0, 1, 2]), + crs="EPSG:2193", + ) + + # Act / Assert + with pytest.raises(NotImplementedError, match="force_identical_write=True"): + tmp_geoboard.pin_write( + gdf, name="test-gdf", type="gpkg", force_identical_write=True + ) diff --git a/tests/geopins/drivers/gdf/filetypes/test_parquet.py b/tests/geopins/drivers/gdf/filetypes/test_parquet.py index 53dbfdc..21b9da8 100644 --- a/tests/geopins/drivers/gdf/filetypes/test_parquet.py +++ b/tests/geopins/drivers/gdf/filetypes/test_parquet.py @@ -3,6 +3,7 @@ from typing import TYPE_CHECKING import geopandas as gpd +import pytest from pins.meta import Meta from geopins.boards import GeoBaseBoard @@ -26,3 +27,18 @@ def test_round_trip(tmp_geoboard: GeoBaseBoard): # Assert assert gdf.equals(retrieved) + + +def test_force_identical_write_raises(tmp_geoboard: GeoBaseBoard): + # Arrange + gdf = gpd.GeoDataFrame( + {"id": [1, 2, 3]}, + geometry=gpd.points_from_xy([0, 1, 2], [0, 1, 2]), + crs="EPSG:4326", + ) + + # Act / Assert + with pytest.raises(NotImplementedError, match="force_identical_write=True"): + tmp_geoboard.pin_write( + gdf, name="test-gdf", type="parquet", force_identical_write=True + ) diff --git a/tests/geopins/drivers/raster/filetypes/test_tif.py b/tests/geopins/drivers/raster/filetypes/test_tif.py index 2d9a1df..22f7b54 100644 --- a/tests/geopins/drivers/raster/filetypes/test_tif.py +++ b/tests/geopins/drivers/raster/filetypes/test_tif.py @@ -2,6 +2,7 @@ from typing import TYPE_CHECKING +import pytest from pins.meta import Meta from rastr.raster import Raster @@ -22,3 +23,14 @@ def test_round_trip(tmp_geoboard: GeoBaseBoard): # Assert assert raster == retrieved + + +def test_force_identical_write_raises(tmp_geoboard: GeoBaseBoard): + # Arrange + raster = Raster.example() + + # Act / Assert + with pytest.raises(NotImplementedError, match="force_identical_write=True"): + tmp_geoboard.pin_write( + raster, name="test-raster", type="tif", force_identical_write=True + )