paleolimbot commented on code in PR #778:
URL: https://github.com/apache/sedona-db/pull/778#discussion_r3126968892


##########
python/sedonadb/tests/io/test_pyogrio.py:
##########
@@ -131,6 +132,43 @@ def test_read_ogr_filter(con):
         )
 
 
+def test_read_ogr_layer_selection(con):
+    series = geopandas.GeoSeries.from_xy([0, 1], [1, 2], crs="EPSG:3857")
+    gdf = geopandas.GeoDataFrame({"val": ["a", "b"], "wkb_geometry": series})
+    gdf = gdf.set_geometry(gdf["wkb_geometry"])

Review Comment:
   ```suggestion
       gdf = geopandas.GeoDataFrame({"val": ["a", "b"], "geom": series})
       gdf = gdf.set_geometry(gdf["geom"])
   ```



##########
python/sedonadb/tests/io/test_pyogrio.py:
##########
@@ -131,6 +132,43 @@ def test_read_ogr_filter(con):
         )
 
 
+def test_read_ogr_layer_selection(con):
+    series = geopandas.GeoSeries.from_xy([0, 1], [1, 2], crs="EPSG:3857")
+    gdf = geopandas.GeoDataFrame({"val": ["a", "b"], "wkb_geometry": series})
+    gdf = gdf.set_geometry(gdf["wkb_geometry"])
+
+    with tempfile.TemporaryDirectory() as td:
+        gpkg_path = f"{td}/test.gpkg"
+        gdf.to_file(gpkg_path, layer="my_layer")
+
+        # Reading with the correct layer name should work
+        geopandas.testing.assert_geodataframe_equal(
+            con.read_pyogrio(gpkg_path, options={"layer": 
"my_layer"}).to_pandas(),
+            gdf,
+        )
+
+
+def test_read_ogr_path_suffix(con):
+    series = geopandas.GeoSeries.from_xy([0, 1], [1, 2], crs="EPSG:3857")
+    gdf = geopandas.GeoDataFrame({"val": ["a", "b"], "wkb_geometry": series})
+    gdf = gdf.set_geometry(gdf["wkb_geometry"])

Review Comment:
   ```suggestion
       gdf = geopandas.GeoDataFrame({"val": ["a", "b"], "geom": series})
       gdf = gdf.set_geometry(gdf["geom"])
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to