render as html #40900
Replies: 1 comment
-
|
This is expected behavior — "Render as HTML" only controls how values are displayed in the browser. When you export to CSV/Excel, Superset pulls the raw query results directly, so your Recommended fix: Use Conditional Formatting instead If your goal is just coloring values, use Superset's built-in Conditional Formatting (under the "Customize" tab in the Table chart). This applies colors natively without injecting HTML into the metric, so exports will contain only clean values. Other workarounds:
import re
# Add after verbose_map processing, before CSV/Excel conversion:
for col in df.columns:
if df[col].dtype == "object":
df[col] = df[col].apply(
lambda x: re.sub(r'<[^>]+>', '', x) if isinstance(x, str) else x
)The conditional formatting approach is the cleanest solution since it separates styling from data entirely. To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
so i have used render as html , and i have put span in custom sql metric in table chart m but when i am downloading as excel or csv , the value and the span code is getting downloaded not just the value
@dosu
Beta Was this translation helpful? Give feedback.
All reactions