Bug description

🐛 Inconsistent API Results When Querying Dashboards via /api/v1/dashboard

Description

We conducted a stress test on the /api/v1/dashboard endpoint in Apache Superset and observed inconsistent response behavior. Specifically, some queries returned incorrect or mismatched results, which may indicate issues with the filtering logic, caching, or internal state handling under load.


🔬 Test Setup

  • Endpoint: /api/v1/dashboard?q=...
  • Query Filter:
  {
    "filters": [
      { "col": "dashboard_title", "opr": "eq", "value": "<dashboard title>" }
    ]
  }
  • Authentication: JWT Bearer token + CSRF cookies
  • Concurrency: Sequential async requests using aiohttp
  • Repeat Count: 10 rounds × N dashboards × 10 batch queries
  • Total Requests: 1100

📊 Results Summary

Round Requests Errors Error Rate
1 110 0 0.00%
2 110 3 2.73%
3 110 0 0.00%
4 110 1 0.91%
5 110 0 0.00%
6 110 0 0.00%
7 110 2 1.82%
8 110 2 1.82%
9 110 0 0.00%
10 110 0 0.00%
Total 1100 8 0.73%

⚠️ Observed Behavior

  • In 8 out of 1100 cases, the returned dashboard_title did not match the requested filter value.
  • These mismatches appeared sporadically and were not tied to specific dashboards.
  • Example:

Requested: "deck.gl Demo" Received: null


✅ Expected Behavior

All responses filtered by dashboard_title == X should strictly return:

{
  "result": [
    {
      "dashboard_title": "X",
      ...
    }
  ]
}

If no match exists, the result should be an empty array ([]), not mismatched or incorrect data.


Please let us know if more debug output is needed. We’re happy to provide logs or stress test code to help reproduce.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

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.

Comment From: dosubot[bot]

Hi @LisaHusband! I'm Dosu and I’m helping the superset team.

The inconsistent results you're seeing are likely due to how Superset's /api/v1/dashboard endpoint handles filtering by dashboard_title. The filter always uses a fuzzy, case-insensitive substring match (ILIKE), regardless of whether you specify an equality operator. This means queries like "dashboard_title" == "X" can return dashboards whose titles only partially match "X", especially if multiple dashboards have similar names. This is a known limitation in the current filtering logic and not a concurrency or caching bug reference.

There’s no evidence of API-level caching or concurrency issues affecting query results—most caching is for static assets like thumbnails, not API responses reference.

As a workaround, you can filter the results client-side for exact matches on dashboard_title. If you need strict equality filtering at the API level, it would require a change to the backend filter logic.

If you notice any errors or stack traces in your Superset logs during these mismatches, sharing them could help rule out any unexpected backend issues. Let me know if you want help interpreting log output or want to discuss possible approaches for stricter filtering.

To reply, just mention @dosu.


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

Comment From: LisaHusband

I've created a minimal, self-contained example in Python (separate from my main project code) to demonstrate the issue. The code is available here:

🔗 GitHub Repository: https://github.com/LisaHusband/pruebas

The project includes several sanity checks to verify API connectivity, token handling, and basic Superset behavior. The part of interest for this issue is the function:

async def extress_dataset_api(self, batch_size=10)

This function repeatedly queries the /api/v1/dataset endpoint using filtered parameters, mimicking a high-load scenario. The same logic applies to dashboards via extress_dashboard_api().

You can run the test with:

python probar_api.py  # or with asyncio: python3 -m asyncio probar_api.py

This code should consistently reproduce the error rates reported in the issue description.

Comment From: rusackas

CC @villebro @betodealmeida @dpgaspar