Skip to content

feat(chart): add dynamicQueryObjectCount property to Chart Metadata#33451

Merged
geido merged 1 commit intoapache:masterfrom
DamianPendrak:dynamic-query-object-count
May 19, 2025
Merged

feat(chart): add dynamicQueryObjectCount property to Chart Metadata#33451
geido merged 1 commit intoapache:masterfrom
DamianPendrak:dynamic-query-object-count

Conversation

@DamianPendrak
Copy link
Member

SUMMARY

This PR implements a dynamicQueryObjectCount property to Chart Metadata to allow Chart to have a dynamic number of queries based on Controls. Without this, the Chart will only show 1 query even if more queries are provided.

TESTING INSTRUCTIONS

  1. Use a Chart with more than one query
  2. Add dynamicQueryObjectCount: true to a Chart Metadata
  3. See if there is a correct number of Results tabs in Explore and in "View as table" in Dashboard

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've completed my review and didn't find any issues.

Files scanned
File Path Reviewed
superset-frontend/packages/superset-ui-core/src/chart/models/ChartMetadata.ts
superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@DamianPendrak DamianPendrak changed the title Add dynamicQueryObjectCount property to Chart Metadata feat(chart): add dynamicQueryObjectCount property to Chart Metadata May 15, 2025
@rusackas
Copy link
Member

We already have queryObjectCount so I'm not sure what the use case is for this additional field. I'm by no means against it, but would love to know when/where it'll be used. Could this replace the queryObjectCount field?

Do you have screenshots before/after that we can refer to as well?

Thanks for contributing!

@rusackas rusackas added the review:checkpoint Last PR reviewed during the daily review standup label May 15, 2025
@DamianPendrak
Copy link
Member Author

Right, there is a queryObjectCount but it forces you to decide what will be the max number of queries in the Chart - then the queries are limited to this value. If it's set to a big number, then there are multiple empty result tabs even though there are no queries created by the Chart:

Screenshot 2025-05-15 at 20 02 45

With the dynamicQueryObjectCount it will display just one tab:

Screenshot 2025-05-15 at 20 04 39

Then, when any number of queries is created, it will show all of them:

Screenshot 2025-05-15 at 20 06 14

There is the PR that introduced the queryObjectCount: #20816
It looks like there is a use case for limiting the number of queries.

@michael-s-molina michael-s-molina removed the review:checkpoint Last PR reviewed during the daily review standup label May 16, 2025
@geido geido merged commit 0653e12 into apache:master May 19, 2025
66 of 67 checks passed
LevisNgigi pushed a commit to LevisNgigi/superset that referenced this pull request Jun 18, 2025
alexandrusoare pushed a commit to alexandrusoare/superset that referenced this pull request Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants