Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): loading viz_type from request params #31929

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hdahme
Copy link

@hdahme hdahme commented Jan 20, 2025

SUMMARY

Previously, when passing viz_type via the API, it would default to table. This change allows us to send viz_type and have the charts respect it in the UI

TESTING INSTRUCTIONS

Make an API request via python and send the following params

params = {
        "viz_type": "big_number",
        "groupby": columns,
        "metrics": metrics,
        "adhoc_filters": [
            {
                "expressionType": "SQL",
                "sqlExpression": where_clause,
                "clause": "WHERE",
            }
        ]
    }

The resulting chart would always be a table. No longer

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

@dosubot dosubot bot added api Related to the REST API viz:charts Namespace | Anything related to viz types labels Jan 20, 2025
@hdahme hdahme force-pushed the fix-viz-type-in-api-calls branch from f2d6ea8 to a8b5a39 Compare January 20, 2025 05:43
@github-actions github-actions bot removed the api Related to the REST API label Jan 20, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@hdahme hdahme force-pushed the fix-viz-type-in-api-calls branch from a8b5a39 to 23f09f5 Compare January 20, 2025 05:47
Copy link

korbit-ai bot commented Jan 20, 2025

I was unable to post the issues I found. This could be because a force push or squash has changed the commit history since I scanned this pull request. You can get another review by commenting /korbit-review.

@hdahme hdahme force-pushed the fix-viz-type-in-api-calls branch 2 times, most recently from 8ff4471 to c9190ed Compare January 20, 2025 05:49
@hdahme hdahme force-pushed the fix-viz-type-in-api-calls branch from c9190ed to aa211c4 Compare January 20, 2025 05:51
Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

LGTM, but adding additional reviewers who might know better :)

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 65.52%. Comparing base (76d897e) to head (6de663d).
Report is 1349 commits behind head on master.

Files with missing lines Patch % Lines
superset/commands/chart/create.py 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #31929      +/-   ##
==========================================
+ Coverage   60.48%   65.52%   +5.03%     
==========================================
  Files        1931      546    -1385     
  Lines       76236    39292   -36944     
  Branches     8568        0    -8568     
==========================================
- Hits        46114    25745   -20369     
+ Misses      28017    13547   -14470     
+ Partials     2105        0    -2105     
Flag Coverage Δ
hive 48.80% <0.00%> (-0.37%) ⬇️
javascript ?
presto 53.29% <0.00%> (-0.51%) ⬇️
python 65.52% <0.00%> (+2.03%) ⬆️
unit 61.07% <0.00%> (+3.45%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hdahme hdahme changed the title Fix(api): loading viz_type from request params fix(api): loading viz_type from request params Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS viz:charts Namespace | Anything related to viz types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants