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

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

commit 3884a0f0c279f0d5a3f5e86bb1b8a7e17b449a88
Author: Jia Yu <[email protected]>
AuthorDate: Tue Aug 12 15:18:31 2025 -0700

    Fix the missing import paths for some stats functions (#483)
    
    ## Did you read the Contributor Guide?
    
    - Yes, I have read the [Contributor
    Rules](https://sedona.apache.org/latest/community/rule/) and
    [Contributor Development
    Guide](https://sedona.apache.org/latest/community/develop/)
    
    - No, I haven't read it.
    
    ## Is this PR related to a ticket?
    
    - Yes, and the PR name follows the format `[SEDONA-XXX] my subject`.
    - Yes, and the PR name follows the format `[GH-XXX] my subject`. Closes
    #<issue_number>
    
    - No:
    - this is a documentation update. The PR name follows the format `[DOCS]
    my subject`
    - this is a CI update. The PR name follows the format `[CI] my subject`
    
    ## What changes were proposed in this PR?
    
    
    ## How was this patch tested?
    
    
    ## Did this PR include necessary documentation updates?
    
    - Yes, I am adding a new API. I am using the [current SNAPSHOT version
    
number](https://github.com/apache/sedona/blob/99239524f17389fc4ae9548ea88756f8ea538bb9/pom.xml#L29)
    in `vX.Y.Z` format.
    - Yes, I have updated the documentation.
    - No, this PR does not affect any public API so no need to change the
    documentation.
---
 python/sedona/spark/__init__.py             | 11 +++++++----
 python/sedona/spark/stats/__init__.py       |  1 +
 python/sedona/stats/weighting/__init__.py   |  2 ++
 python/tests/test_path_compatibility.py     | 10 ++++++++++
 python/tests/test_path_compatibility_all.py |  3 +++
 5 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/python/sedona/spark/__init__.py b/python/sedona/spark/__init__.py
index 5859bb315a..9f7651107f 100644
--- a/python/sedona/spark/__init__.py
+++ b/python/sedona/spark/__init__.py
@@ -59,11 +59,14 @@ from sedona.spark.sql.types import GeometryType, 
GeographyType, RasterType
 from sedona.spark.stac import Client
 from sedona.spark.stac.collection_client import CollectionClient
 from sedona.spark.stats.clustering.dbscan import dbscan
-from sedona.spark.stats.hotspot_detection.getis_ord import g_local
-from sedona.spark.stats.weighting import (
-    add_distance_band_column,
-    add_binary_distance_band_column,
+from sedona.spark.stats.outlier_detection.local_outlier_factor import (
+    local_outlier_factor,
 )
+from sedona.spark.stats.autocorrelation.moran import MoranResult, Moran
+from sedona.spark.stats.hotspot_detection.getis_ord import g_local
+from sedona.spark.stats.weighting import add_distance_band_column
+from sedona.spark.stats.weighting import add_binary_distance_band_column
+from sedona.spark.stats.weighting import add_weighted_distance_band_column
 from sedona.spark.raster.awt_raster import AWTRaster
 from sedona.spark.raster.data_buffer import DataBuffer
 from sedona.spark.raster.meta import SampleDimension
diff --git a/python/sedona/spark/stats/__init__.py 
b/python/sedona/spark/stats/__init__.py
index d383b33fa1..8284081db2 100644
--- a/python/sedona/spark/stats/__init__.py
+++ b/python/sedona/spark/stats/__init__.py
@@ -18,6 +18,7 @@ from sedona.spark.stats.clustering.dbscan import dbscan
 from sedona.spark.stats.outlier_detection.local_outlier_factor import (
     local_outlier_factor,
 )
+from sedona.spark.stats.autocorrelation.moran import MoranResult, Moran
 from sedona.spark.stats.hotspot_detection.getis_ord import g_local
 from sedona.spark.stats.weighting import add_distance_band_column
 from sedona.spark.stats.weighting import add_binary_distance_band_column
diff --git a/python/sedona/stats/weighting/__init__.py 
b/python/sedona/stats/weighting/__init__.py
index 9573badc6c..f4c0c76e78 100644
--- a/python/sedona/stats/weighting/__init__.py
+++ b/python/sedona/stats/weighting/__init__.py
@@ -18,6 +18,7 @@
 from sedona.spark.stats.weighting import (
     add_distance_band_column,
     add_binary_distance_band_column,
+    add_weighted_distance_band_column,
 )
 
 import warnings
@@ -31,4 +32,5 @@ warnings.warn(
 __all__ = [
     "add_distance_band_column",
     "add_binary_distance_band_column",
+    "add_weighted_distance_band_column",
 ]
diff --git a/python/tests/test_path_compatibility.py 
b/python/tests/test_path_compatibility.py
index 67763025ab..1217b78130 100644
--- a/python/tests/test_path_compatibility.py
+++ b/python/tests/test_path_compatibility.py
@@ -27,6 +27,14 @@ from sedona.core.geom.envelope import Envelope
 from sedona.core.geom.geography import Geography
 from sedona.core.spatialOperator import JoinQuery
 from sedona.core.spatialOperator import JoinQueryRaw, KNNQuery, RangeQuery
+from sedona.stats.clustering.dbscan import dbscan
+from sedona.stats.outlier_detection.local_outlier_factor import (
+    local_outlier_factor,
+)
+from sedona.stats.hotspot_detection.getis_ord import g_local
+from sedona.stats.weighting import add_distance_band_column
+from sedona.stats.weighting import add_binary_distance_band_column
+from sedona.stats.weighting import add_weighted_distance_band_column
 
 from sedona.sql import st_aggregates as sta
 from sedona.sql import st_constructors as stc
@@ -103,6 +111,8 @@ class TestPathCompatibility(TestBase):
         assert g_local is not None
         assert add_distance_band_column is not None
         assert add_binary_distance_band_column is not None
+        assert add_weighted_distance_band_column is not None
+        assert local_outlier_factor is not None
 
     def test_util_imports(self):
         # Test utility imports
diff --git a/python/tests/test_path_compatibility_all.py 
b/python/tests/test_path_compatibility_all.py
index 9a37ac4ff2..a4eff96a23 100644
--- a/python/tests/test_path_compatibility_all.py
+++ b/python/tests/test_path_compatibility_all.py
@@ -66,11 +66,14 @@ class TestPathCompatibilityAll(TestBase):
         assert g_local is not None
         assert add_distance_band_column is not None
         assert add_binary_distance_band_column is not None
+        assert add_weighted_distance_band_column is not None
+        assert local_outlier_factor is not None
 
     def test_util_imports(self):
         # Test utility imports
         assert Adapter is not None
         assert GeoData is not None
+        assert StructuredAdapter is not None
 
     def test_format_mapper_imports(self):
         # Test GeoJsonReader and ShapefileReader imports

Reply via email to