Copilot commented on code in PR #38:
URL: https://github.com/apache/sedona-db/pull/38#discussion_r2331476658
##########
python/sedonadb/tests/functions/test_transforms.py:
##########
@@ -50,7 +50,23 @@ def test_st_setsrid(eng, geom, srid, expected_srid):
assert df.crs == pyproj.CRS(expected_srid)
-# PostGIS does not have an API ST_SetCrs
[email protected]("eng", [SedonaDB, PostGIS])
[email protected](
+ ("geom", "srid", "expected_srid"),
+ [
+ ("POINT (1 1)", 3857, 3857),
+ ("POINT (1 1)", 0, 0),
+ ],
+)
+def test_st_srid(eng, geom, srid, expected_srid):
+ eng = eng.create_or_skip()
+ eng.assert_query_result(
+ f"SELECT ST_SRID(ST_SetSrid({geom_or_null(geom)},
{val_or_null(srid)}))",
+ expected_srid,
+ )
+
+
+# PostGIS does not have an APIs ST_SetCrs, ST_Crs
Review Comment:
Grammar error: 'APIs' should be 'API' (singular) since it refers to the
PostGIS API.
```suggestion
# PostGIS does not have an API ST_SetCrs, ST_Crs
```
##########
rust/sedona-functions/src/st_srid.rs:
##########
@@ -152,4 +226,37 @@ mod test {
assert!(result.is_err());
assert!(result.unwrap_err().to_string().contains("CRS has no SRID"));
}
+
+ #[test]
+ fn udf_crs() {
+ let udf: ScalarUDF = st_crs_udf().into();
+
+ // Test that when no CRS is set, SRID is 0
Review Comment:
The comment incorrectly references SRID when the test is for CRS
functionality. Should be 'Test that when no CRS is set, CRS is null' or similar.
```suggestion
// Test that when no CRS is set, CRS is null
```
--
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]