mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat(advanced analysis): support MultiIndex column in post processing stage (#19116)
This commit is contained in:
@@ -21,7 +21,7 @@ from flask_babel import gettext as _
|
||||
from geopy.point import Point
|
||||
from pandas import DataFrame
|
||||
|
||||
from superset.exceptions import QueryObjectValidationError
|
||||
from superset.exceptions import InvalidPostProcessingError
|
||||
from superset.utils.pandas_postprocessing.utils import _append_columns
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ def geohash_decode(
|
||||
df, lonlat_df, {"latitude": latitude, "longitude": longitude}
|
||||
)
|
||||
except ValueError as ex:
|
||||
raise QueryObjectValidationError(_("Invalid geohash string")) from ex
|
||||
raise InvalidPostProcessingError(_("Invalid geohash string")) from ex
|
||||
|
||||
|
||||
def geohash_encode(
|
||||
@@ -69,7 +69,7 @@ def geohash_encode(
|
||||
)
|
||||
return _append_columns(df, encode_df, {"geohash": geohash})
|
||||
except ValueError as ex:
|
||||
raise QueryObjectValidationError(_("Invalid longitude/latitude")) from ex
|
||||
raise InvalidPostProcessingError(_("Invalid longitude/latitude")) from ex
|
||||
|
||||
|
||||
def geodetic_parse(
|
||||
@@ -111,4 +111,4 @@ def geodetic_parse(
|
||||
columns["altitude"] = altitude
|
||||
return _append_columns(df, geodetic_df, columns)
|
||||
except ValueError as ex:
|
||||
raise QueryObjectValidationError(_("Invalid geodetic string")) from ex
|
||||
raise InvalidPostProcessingError(_("Invalid geodetic string")) from ex
|
||||
|
||||
Reference in New Issue
Block a user