petern48 commented on code in PR #381:
URL: https://github.com/apache/sedona-db/pull/381#discussion_r2573437608
##########
python/sedonadb/tests/functions/test_functions.py:
##########
@@ -1178,6 +1178,115 @@ def test_st_hasz(eng, geom, expected):
eng.assert_query_result(f"SELECT ST_HasZ({geom_or_null(geom)})", expected)
[email protected]("eng", [SedonaDB, PostGIS])
[email protected](
+ ("geom", "index", "expected"),
+ [
+ # I. Null/Empty/Non-Polygon Inputs
+ # NULL input
+ (None, 1, None),
+ # POINT
+ ("POINT (0 0)", 1, None),
+ # POINT EMPTY
+ ("POINT EMPTY", 1, None),
+ # LINESTRING
+ ("LINESTRING (0 0, 0 1, 1 2)", 1, None),
+ # LINESTRING EMPTY
+ ("LINESTRING EMPTY", 1, None),
+ # MULTIPOINT
+ ("MULTIPOINT ((0 0), (1 1))", 1, None),
+ # MULTIPOLYGON (Interior rings are within constituent Polygons, not
the MultiPolygon itself)
+ ("MULTIPOLYGON (((1 1, 1 3, 3 3, 3 1, 1 1)))", 1, None),
+ # GEOMETRYCOLLECTION
+ ("GEOMETRYCOLLECTION (POINT(1 1))", 1, None),
+ # II. Polygon Edge Cases
+ # POLYGON EMPTY
+ ("POLYGON EMPTY", 1, None),
+ # Polygon with NO interior rings, index=1
+ ("POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))", 1, None),
+ # Invalid index n=0 (Assuming 1-based indexing means n=0 is
invalid/out of range)
+ ("POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))", 0, None),
Review Comment:
Testing a negative index case would be nice
--
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]