This is an automated email from the ASF dual-hosted git repository. jiayu pushed a commit to branch prepare-1.7.2 in repository https://gitbox.apache.org/repos/asf/sedona.git
commit 02e57ef54185fc1e711868261e249034655d0354 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
