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 9c0b1ba5de [GH-1931] Move packaging module import to geopandas
try-except block (#1932)
9c0b1ba5de is described below
commit 9c0b1ba5de42112582cd98b5c9f2e95c840dfdbe
Author: Olly Beagley <[email protected]>
AuthorDate: Wed Apr 30 19:09:34 2025 +0100
[GH-1931] Move packaging module import to geopandas try-except block (#1932)
---
python/sedona/maps/SedonaMapUtils.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/python/sedona/maps/SedonaMapUtils.py
b/python/sedona/maps/SedonaMapUtils.py
index ddca721c45..d1385e8d98 100644
--- a/python/sedona/maps/SedonaMapUtils.py
+++ b/python/sedona/maps/SedonaMapUtils.py
@@ -19,7 +19,6 @@ import json
from sedona.sql.types import GeometryType
from sedona.utils.geoarrow import dataframe_to_arrow
-from packaging.version import parse
class SedonaMapUtils:
@@ -46,6 +45,9 @@ class SedonaMapUtils:
return data_pyarrow.to_pandas()
try:
import geopandas as gpd
+
+ # packaging is a dependency of geopandas
+ from packaging.version import parse
except ImportError:
msg = "GeoPandas is missing. You can install it manually or via
apache-sedona[kepler-map] or apache-sedona[pydeck-map]."
raise ImportError(msg) from None