lilyvc opened a new issue, #44872:
URL: https://github.com/apache/superset/issues/44872
### Bug description
When a geohash-decode chart's query returns zero rows, the post-processing
step reports "Invalid geohash string" — implying the data contains a malformed
geohash — when the real problem is simply that there are no rows at all.
**How to reproduce the bug**
```python
from pandas import DataFrame
from superset.utils.pandas_postprocessing.geography import geohash_decode
# Any query result with 0 rows:
geohash_decode(DataFrame({"gh": []}), "gh", "lon", "lat")
# InvalidPostProcessingError: Invalid geohash string
```
`geography.py` unpacks `zip(*df[geohash].apply(decode))` into `(latitude,
longitude)`; on an empty frame `zip(*...)` yields nothing, the unpack raises
`ValueError: not enough values to unpack`, and the except clause re-raises it
as `InvalidPostProcessingError("Invalid geohash string")`.
**Expected results**
An empty result set should return an empty frame (chart renders "no data"),
and "Invalid geohash string" should only surface when a value actually fails to
decode.
**Actual results**
Every empty geohash query is reported to the user as a data-format error,
sending debugging effort in the wrong direction.
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.11
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [ ] I have checked Superset's logs for errors and if I found a relevant
Python stacktrace, I included it here as text in the "additional context"
section.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]