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.

Comment From: dosubot[bot]

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

Comment From: geido


🎉 Preset Bounty Available: $150 USD 🎉

To claim this bounty, please carefully follow the steps below.


📋 Steps to Participate

  1. Review Guidelines:
    Read through the Preset Bounty Program Contribution Guide for complete details on bounty requirements.

  2. Show Your Interest:
    Complete the Preset Bounty Program Survey and comment this issue to express your interest.

  3. Join the Slack Channel:
    After completing the survey, you’ll receive an invitation to the dedicated Apache Superset Slack channel.

  4. Get Assigned:
    To officially start, ensure a Bounty Program Manager has assigned you to this issue.

  5. Submit Your Solution:
    When ready, submit your solution with the Fixes #{issue_number} notation in your Pull Request description.

  6. Claim Your Bounty:
    Sign up at GitPay.me and submit your solution via: https://gitpay.me/#/task/1210


💡 Additional Notes

  • Only developers assigned by a Bounty Program Manager should start working on this issue to win the bounty.
  • Be sure to follow the guide closely to avoid any delays in payment. Please, allow a few days after your PR has been merged for the bounty to be released.

Good luck, and happy coding! 🎉

Comment From: Nandu9494

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

Comment From: LisaHusband

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

Comment From: Niharika0104

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

Comment From: msyavuz

@Niharika0104 @Nandu9494 is already working on this.

Comment From: Nandu9494

Hi, I started working on this

Comment From: ayaankhan54

@msyavuz I would like to work on this pr.