yutannihilation commented on code in PR #503:
URL: https://github.com/apache/sedona-db/pull/503#discussion_r2679050106


##########
python/sedonadb/tests/functions/test_functions.py:
##########
@@ -1797,6 +1797,58 @@ def test_st_isring_non_linestring_error(eng, geom):
         eng.assert_query_result(f"SELECT 
ST_IsRing(ST_GeomFromText('{geom}'))", None)
 
 
[email protected]("eng", [SedonaDB, PostGIS])
[email protected](
+    ("geom", "expected"),
+    [
+        (None, None),
+        ("MULTILINESTRING ((0 0, 1 0), (1 0, 1 1))", "LINESTRING (0 0, 1 0, 1 
1)"),
+        (
+            "MULTILINESTRING ((0 0, 1 0), (1 1, 1 0))",
+            "LINESTRING (0 0, 1 0, 1 1)",
+        ),  # opposite direction
+        (
+            "MULTILINESTRING ((0 0, 1 0), (8 8, 9 9))",
+            "MULTILINESTRING ((0 0, 1 0), (8 8, 9 9))",
+        ),
+        # Note that the behaviour on non-multilinestring geometry is not 
documented.
+        # But, we test such cases here as well to detect if there's any 
difference.
+        ("POINT (0 0)", "GEOMETRYCOLLECTION EMPTY"),
+        ("LINESTRING (0 0, 1 0)", "LINESTRING (0 0, 1 0)"),
+        ("POLYGON ((0 0, 0 1, 1 0, 0 0))", "LINESTRING (0 0, 0 1, 1 0, 0 0)"),

Review Comment:
   Thanks for catching. I simply didn't notice the note...
   
   I'll add empty cases.



-- 
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