paleolimbot commented on code in PR #498:
URL: https://github.com/apache/sedona-db/pull/498#discussion_r2678182842
##########
python/sedonadb/tests/functions/test_functions.py:
##########
@@ -1296,6 +1296,30 @@ def test_st_geomfromtext_with_srid(eng, wkt, srid,
expected):
)
[email protected]("eng", [SedonaDB, PostGIS])
[email protected](
+ ("ewkt", "expected", "expected_srid"),
+ [
+ ("SRID=4326;POINT (0 0)", "POINT (0 0)", 4326),
Review Comment:
```suggestion
(None, None, None),
("SRID=4326;POINT (0 0)", "POINT (0 0)", 4326),
```
I think this should work (nulls propagate)
##########
python/sedonadb/tests/functions/test_functions.py:
##########
@@ -1296,6 +1296,30 @@ def test_st_geomfromtext_with_srid(eng, wkt, srid,
expected):
)
[email protected]("eng", [SedonaDB, PostGIS])
[email protected](
+ ("ewkt", "expected", "expected_srid"),
+ [
+ ("SRID=4326;POINT (0 0)", "POINT (0 0)", 4326),
+ ("SRID=3857;POINT (0 0)", "POINT (0 0)", 3857),
+ ("SRID=0;POINT (0 0)", "POINT (0 0)", 0),
+ ],
+)
+def test_st_geomfromewkt(eng, ewkt, expected, expected_srid):
+ if ewkt is not None:
+ ewkt = f"'{ewkt}'"
+ eng = eng.create_or_skip()
+ # TODO: currently, a per-item-CRS geometry cannot be cast to string
+ # eng.assert_query_result(
+ # f"SELECT ST_GeomFromEWKT({val_or_null(ewkt)})",
+ # expected,
+ # )
Review Comment:
If you rebase or merge in the main branch I think this will work:
```suggestion
eng.assert_query_result(
f"SELECT ST_AsWKT(ST_GeomFromEWKT({val_or_null(ewkt)}))",
expected,
)
```
https://github.com/apache/sedona-db/blob/af5e94799418470fec391657666ae0daad68ff44/rust/sedona-functions/src/st_astext.rs#L38
Also feel free to remove this bit and I can follow up when I do
ST_GeomFromEKWB() (FWIW I prefer not to merge TODOs that don't have an tracker
link associated with them, since TODOs in the code base are much harder to
prioritize than issues.)
--
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]