This is an automated email from the ASF dual-hosted git repository.

jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sedona.git


The following commit(s) were added to refs/heads/master by this push:
     new a96bb1f95 [SEDONA-545] Fix importing GeometryType from sedona.spark 
(#1532)
a96bb1f95 is described below

commit a96bb1f9597d7633edf3f5fc94579242c1f784d7
Author: Kristin Cowalcijk <[email protected]>
AuthorDate: Thu Aug 1 03:20:20 2024 +0800

    [SEDONA-545] Fix importing GeometryType from sedona.spark (#1532)
---
 python/sedona/sql/st_functions.py            | 2 +-
 python/tests/sql/test_st_function_imports.py | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/python/sedona/sql/st_functions.py 
b/python/sedona/sql/st_functions.py
index e9d07f8f6..f95a45288 100644
--- a/python/sedona/sql/st_functions.py
+++ b/python/sedona/sql/st_functions.py
@@ -2050,4 +2050,4 @@ def ST_Rotate(geometry: ColumnOrName, angle: 
Union[ColumnOrName, float], originX
 
 # Automatically populate __all__
 __all__ = [name for name, obj in inspect.getmembers(sys.modules[__name__])
-           if inspect.isfunction(obj)]
+           if inspect.isfunction(obj) and name != 'GeometryType']
diff --git a/python/tests/sql/test_st_function_imports.py 
b/python/tests/sql/test_st_function_imports.py
index 5ffb650ed..81bc768f1 100644
--- a/python/tests/sql/test_st_function_imports.py
+++ b/python/tests/sql/test_st_function_imports.py
@@ -33,3 +33,8 @@ class TestStFunctionImport(TestBase):
         ST_Point
         ST_Contains
         ST_Envelope_Aggr
+
+    def test_geometry_type_should_be_a_sql_type(self):
+        from sedona.spark import GeometryType
+        from pyspark.sql.types import UserDefinedType
+        assert isinstance(GeometryType(), UserDefinedType)

Reply via email to