Repository navigation
fix(semantic-layer): explain a refused semantic view batch in the add modal - #45902
Draft
mikebridge wants to merge 1 commit into
Draft
mikebridge wants to merge 1 commit into
mikebridge wants to merge 1 commit into
Conversation
… modal The bulk creation endpoint refuses an oversized batch with HTTP 400 before any provider lookup, naming the configured limit. The Add Semantic View modal only parsed HTTP 422 bodies, so that refusal surfaced as the generic failure toast. Show the host's refusal inline and as a toast, keep the selection so the user can trim it and retry, and fall back to the generic message for anything other than a plain string message.
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #45902 +/- ##
=======================================
Coverage 84.73% 84.73%
=======================================
Files 3069 3069
Lines 205771 205780 +9
Branches 48396 48399 +3
=======================================
+ Hits 174354 174362 +8
- Misses 28123 28124 +1
Partials 3294 3294
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
TL;DR: When someone selects more semantic views than the server allows in one request, the Add Semantic View modal now tells them so, using the server's own message with the configured limit, instead of a generic "An error occurred" toast. The selection stays in place so they can trim it and retry.
Background. Bulk semantic view creation refuses an oversized batch up front, before it looks up any view with the provider, and answers with HTTP 400 and a message such as "Too many views in one request: 101 provided, at most 100 allowed." The limit is operator-configurable, so the UI cannot hard-code it.
Problem. The modal only parsed HTTP 422 responses (the per-view partial-success shape). A 400 fell through to the generic failure path, so the user never saw why the batch was refused or what the limit is.
Changes.
creationResult.ts: a smallbatchRefusalMessagehelper that accepts only a plain stringmessagefrom the 400 body; anything else yields the generic message rather than echoing an unexpected body.AddSemanticViewModal.tsx: the save handler shows that message inline (in the existing failure list) and as a danger toast, leaves the selected views untouched, and does not call the success or hide callbacks. HTTP 422 handling and every other status are unchanged.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: selecting more views than the limit and clicking Add shows the toast "An error occurred while adding semantic views".
After: the toast and the inline failure list read "Too many views in one request: 101 provided, at most 100 allowed." and the selection is kept.
TESTING INSTRUCTIONS
SEMANTIC_VIEW_BULK_CREATE_MAX_VIEWS = 2insuperset_config.pyand restart.cd superset-frontend && npx jest src/features/semanticViews.ADDITIONAL INFORMATION