mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
fix(histogram): add NULL handling for histogram (#35693)
Co-authored-by: Rachel Pan <r.pan@mail.utoronto.ca> Co-authored-by: Rachel Pan <panrrachel@gmail.com> Co-authored-by: Janani Gurram <68124448+JG-ctrl@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -48,6 +48,11 @@ def histogram(
|
||||
if groupby is None:
|
||||
groupby = []
|
||||
|
||||
# drop empty values from the target column
|
||||
df = df.dropna(subset=[column])
|
||||
if df.empty:
|
||||
return df
|
||||
|
||||
# convert to numeric, coercing errors to NaN
|
||||
df[column] = to_numeric(df[column], errors="coerce")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user