You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2026/10/05 02:04:37 UTC

Re: [PR] fix(c/sedona-geos): preserve Z/M in empty simple geometries (#1384) [sedona-db]

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


##########
python/sedonadb/tests/functions/test_geos_empty.py:
##########
@@ -0,0 +1,60 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import pytest
+
+
+@pytest.mark.parametrize("geometry_type", ["POINT", "LINESTRING", "POLYGON"])
+@pytest.mark.parametrize("dimension", ["", " Z", " M", " ZM"])
+@pytest.mark.parametrize(
+    "function",
+    [
+        "ST_Normalize(g)",
+        "ST_MakeValid(g)",
+        "ST_Simplify(g, 1)",
+        "ST_SimplifyPreserveTopology(g, 1)",
+    ],
+)

Review Comment:
   For these tests, can you add these as cases to the corresponding tests for the original functions? We'll want them for any implementation, now or future, geos or otherwise!



##########
c/sedona-geos/src/st_normalize.rs:
##########
@@ -171,6 +171,27 @@ mod tests {
         tester.assert_scalar_result_equals(result, already_normal);
     }
 
+    #[rstest]
+    fn udf_empty_simple_geometry_dimensions(
+        #[values(WKB_GEOMETRY, sedona_schema::datatypes::WKB_VIEW_GEOMETRY)]

Review Comment:
   You'll have to add the import here too, but:
   
   ```suggestion
           #[values(WKB_GEOMETRY, WKB_VIEW_GEOMETRY)]
   ```



-- 
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: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org