superset icon indicating copy to clipboard operation
superset copied to clipboard

Using Drill by in a dashboard doesn't work in columns created with <a> tags

Open yousoph opened this issue 6 months ago • 1 comments

Description

If you create a chart (e.g. Table Chart) with a custom SQL query that has an <a>, the resulting chart can be created and nested in a dashboard and you won’t be able to use the Drill by feature with it because nothing appears.

How to reproduce the bug

  1. Create a Table chart
  2. Use as dimension a column that has a <a> tag applied in the Custom SQL section. It could be something like this '<a href="https://www.google.com/search?q=' || Product_Category || '">' || Product_Category || '</a>'
  3. Save the chart in a dashboard and then use the Drill by feature in that column

Image

Expected results

The prompted window after using Drill by shows you the details of the category

Actual results

The prompted window after using Drill by doesn’t show anything

Image

Known Workarounds

No workarounds are currently known

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [x] 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.

yousoph avatar Jun 13 '25 22:06 yousoph

This is a known limitation in how Drill by works with columns containing HTML, such as tags. The root cause is that when you use Drill by on a table cell, Superset passes the raw SQL value (which includes the HTML markup) as the filter value, rather than the plain text label that’s displayed to users. Since the filter value includes the HTML, it doesn’t match the expected values in the dataset, so no results are shown. The table chart does sanitize and render HTML for display, but the Drill by logic doesn’t strip HTML before filtering, which causes this disconnect reference.

There isn’t a built-in workaround right now. To address this, the code that handles Drill by/context menu events should strip HTML tags from the filter value before applying the filter. The codebase already includes utilities for HTML sanitization and tag removal, so this would be a straightforward fix for a developer familiar with the frontend code reference.

No existing tickets or documentation specifically address this scenario, but the technical root cause is clear from the code. If you need to use Drill by on these columns, you’ll need to avoid embedding HTML in the dimension values, or consider a code change to strip HTML before filtering.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

dosubot[bot] avatar Jun 13 '25 22:06 dosubot[bot]

@geido would like to take this, Please assign to me

Nandu9494 avatar Jun 25 '25 13:06 Nandu9494

@geido If this issue hasn’t been assigned yet, I’d love to take it on

LisaHusband avatar Jul 08 '25 08:07 LisaHusband

@msyavuz it's been 16 days and there is no activity,I would like to get this issue assigned

Niharika0104 avatar Jul 11 '25 03:07 Niharika0104

@Niharika0104 @Nandu9494 is already working on this.

msyavuz avatar Jul 11 '25 05:07 msyavuz

Hi, I started working on this

Nandu9494 avatar Jul 11 '25 06:07 Nandu9494

@msyavuz I would like to work on this.

ayaankhan54 avatar Aug 04 '25 22:08 ayaankhan54

Hi, @msyavuz. Really sorry this took me some time, I have finally raised the PR, please take a look when you have time. Thanks!

Nandu9494 avatar Aug 07 '25 21:08 Nandu9494

Hey @msyavuz I would like to work on this.

daksh2048 avatar Oct 11 '25 22:10 daksh2048

Hey @msyavuz I would like to work on this.

This issue has already been solved and the pr is about to be merged so you should find something else to work on.

syedbarimanjan avatar Oct 12 '25 00:10 syedbarimanjan