Skip to content

fix: Matching errorType on superset api error with SupersetError #34261

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

Merged

Conversation

justinpark
Copy link
Member

SUMMARY

For Airbnb, we display custom errors according to the error_type. However, in the current Superset API, unlike the query result API, SupersetApiError is thrown, and error_type is mapped to errorType, which causes custom overrides to not work properly. In this PR, I have resolved the issue by correcting the type of the errorType value.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
Screenshot 2025-07-21 at 1 45 19 PM

After:
Screenshot 2025-07-21 at 1 45 02 PM

TESTING INSTRUCTIONS

locally

@dosubot dosubot bot added api Related to the REST API change:frontend Requires changing the frontend labels Jul 21, 2025
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/src/components/ErrorMessage/ErrorMessageWithStackTrace.tsx
superset-frontend/packages/superset-ui-core/src/query/types/Query.ts
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx

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

@github-actions github-actions bot removed the api Related to the REST API label Jul 21, 2025
@pull-request-size pull-request-size bot added size/S and removed size/M labels Jul 21, 2025
@@ -454,16 +455,14 @@ class DatasourceControl extends PureComponent {
{isMissingDatasource && !isMissingParams && (
<div className="error-alert">
{extra?.error ? (
<div className="error-alert">
Copy link
Member Author

Choose a reason for hiding this comment

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

removed redundant same error-alert wrapper

@@ -255,6 +255,7 @@ export type ErrorSource = 'dashboard' | 'explore' | 'sqllab' | 'crud';

export type SupersetError<ExtraType = Record<string, any> | null> = {
error_type: ErrorType;
errorType?: ErrorType;
Copy link
Member

Choose a reason for hiding this comment

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

@justinpark Can't we fix the API responses to use the same field? Having both in the type definition looks really bad and is an indicative that we should fix the APIs.

@github-actions github-actions bot removed the packages label Jul 22, 2025
@justinpark justinpark merged commit 229d925 into apache:master Jul 22, 2025
56 checks passed
@michael-s-molina michael-s-molina added the v5.0 Label added by the release manager to track PRs to be included in the 5.0 branch label Jul 23, 2025
michael-s-molina pushed a commit that referenced this pull request Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:frontend Requires changing the frontend size/S v5.0 Label added by the release manager to track PRs to be included in the 5.0 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants