Skip to content

Conversation

@justinpark
Copy link
Member

@justinpark justinpark commented Jan 7, 2026

SUMMARY

The existing query status indicator makes it difficult to predict the progress, so this commit introduces a new progress status that shows which stage is currently in progress. This change will allow users to more accurately anticipate the query execution process and wait accordingly.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

before--query-state.mov

After:

improved_query_state.mov
  • percent progress
progress_query_state.mov
  • failed in running
failed_query.mov

TESTING INSTRUCTIONS

specs are added

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

@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 7, 2026

Code Review Agent Run #ebadeb

Actionable Suggestions - 0
Additional Suggestions - 2
  • superset-frontend/src/SqlLab/actions/sqlLab.ts - 1
    • Incorrect state assignment for sync queries · Line 396-396
      This change sets the query state to 'pending' unconditionally, but the original logic differentiated between async ('pending') and sync ('running') queries. For sync queries, the state should be 'running' since they execute immediately. If this is intentional, consider updating any dependent UI logic that might expect 'running' for sync queries.
  • superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx - 1
    • Correctness: Missing validation in initial state · Line 38-40
      The initial state now computes the duration if both startTime and endTime are provided, which is good for static timers. However, it should also check if startTime < endTime, matching the useEffect logic, to avoid showing meaningless negative durations when endTime <= startTime.
      Code suggestion
      --- a/superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx
      +++ b/superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx
       @@ -37,6 +37,6 @@ export function Timer({
          const theme = useTheme();
      -  const [clockStr, setClockStr] = useState(
      -    startTime && endTime ? fDuration(startTime, endTime) : '00:00:00.00',
      -  );
      +  const [clockStr, setClockStr] = useState(
      +    startTime && endTime && startTime < endTime ? fDuration(startTime, endTime) : '00:00:00.00',
      +  );
          const timer = useRef<ReturnType<typeof setInterval>>();
Review Details
  • Files reviewed - 7 · Commit Range: 3e6e11c..3e6e11c
    • superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx
    • superset-frontend/packages/superset-ui-core/src/query/types/Query.ts
    • superset-frontend/src/SqlLab/actions/sqlLab.ts
    • superset-frontend/src/SqlLab/components/QueryStatusBar/QueryStatusBar.test.tsx
    • superset-frontend/src/SqlLab/components/QueryStatusBar/index.tsx
    • superset-frontend/src/SqlLab/components/ResultSet/index.tsx
    • superset-frontend/src/SqlLab/components/SouthPane/Results.tsx
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot bot added the sqllab Namespace | Anything related to the SQL Lab label Jan 7, 2026
@justinpark justinpark requested review from michael-s-molina, mistercrunch and rusackas and removed request for rusackas January 7, 2026 02:06
@netlify
Copy link

netlify bot commented Jan 7, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 3e6e11c
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/695dbf10791c8000084eeeb5
😎 Deploy Preview https://deploy-preview-36936--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

);
const prevStepRef = useRef<number>(0);
const progress =
query.progress > 0 ? parseInt(query.progress.toFixed(0), 10) : undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Calls toFixed on query.progress without ensuring it's a number; if query.progress is undefined this will throw. Guard the access and use a safe rounding method when query.progress is a number. [type error]

Severity Level: Minor ⚠️

Suggested change
query.progress > 0 ? parseInt(query.progress.toFixed(0), 10) : undefined;
typeof query.progress === 'number' && query.progress > 0
? Math.round(query.progress)
: undefined;
Why it matters? ⭐

If query.progress can be undefined (or a non-number), calling toFixed could throw or generate TypeScript errors. Guarding with a typeof check and using Math.round is clearer and safer for both runtime and type-checking. The current conditional (query.progress > 0) prevents the true-branch from executing when progress is undefined at runtime, but an explicit typeof check is more robust and explicit for maintainers and the type system.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/SqlLab/components/QueryStatusBar/index.tsx
**Line:** 157:157
**Comment:**
	*Type Error: Calls `toFixed` on `query.progress` without ensuring it's a number; if `query.progress` is undefined this will throw. Guard the access and use a safe rounding method when `query.progress` is a number.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

const prevStepRef = useRef<number>(0);
const progress =
query.progress > 0 ? parseInt(query.progress.toFixed(0), 10) : undefined;
const { progress_text: progressText } = query.extra;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Destructuring query.extra without checking it can throw if extra is undefined; access progress_text via optional chaining and provide a safe default instead of directly destructuring from query.extra. [null pointer]

Severity Level: Minor ⚠️

Suggested change
const { progress_text: progressText } = query.extra;
const progressText = query.extra?.progress_text ?? '';
Why it matters? ⭐

The current code destructures query.extra directly which will throw if query.extra is ever undefined at runtime.
Switching to optional chaining is a small, safe defensive change that prevents a potential crash and matches how the value is later used with a fallback (progressText ?? ''). This also avoids TypeScript complaints if extra is typed as optional.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/SqlLab/components/QueryStatusBar/index.tsx
**Line:** 158:158
**Comment:**
	*Null Pointer: Destructuring `query.extra` without checking it can throw if `extra` is undefined; access `progress_text` via optional chaining and provide a safe default instead of directly destructuring from `query.extra`.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

const latestQuery = useSelector(
({ sqlLab: { queries } }: SqlLabRootState) => queries[latestQueryId || ''],
const queries = useSelector(
({ sqlLab: { queries } }: SqlLabRootState) => queries,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Indexing into queries can throw if queries is undefined (e.g. not yet loaded in state). Ensure the selector returns a default empty object or guard the lookup so queries[latestQueryId] is not evaluated on undefined. [null pointer]

Severity Level: Minor ⚠️

Suggested change
({ sqlLab: { queries } }: SqlLabRootState) => queries,
({ sqlLab: { queries } }: SqlLabRootState) => queries ?? {},
Why it matters? ⭐

This is a valid defensive improvement. If the Redux slice guarantees queries is always an object, it's redundant — but that's an assumption. Returning queries ?? {} from the selector prevents a potential runtime TypeError when the state is temporarily undefined (e.g. during hydration). The proposed change is small, correct, and safe.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/SqlLab/components/SouthPane/Results.tsx
**Line:** 57:57
**Comment:**
	*Null Pointer: Indexing into `queries` can throw if `queries` is undefined (e.g. not yet loaded in state). Ensure the selector returns a default empty object or guard the lookup so `queries[latestQueryId]` is not evaluated on undefined.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

<ResultSet
search
queryId={latestQuery.id}
database={databases[latestQuery.dbId]}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Accessing databases[latestQuery.dbId] can throw if databases is undefined; guard the access so the prop passed to ResultSet is undefined when databases is missing, preventing a runtime exception. [null pointer]

Severity Level: Minor ⚠️

Suggested change
database={databases[latestQuery.dbId]}
database={databases ? databases[latestQuery.dbId] : undefined}
Why it matters? ⭐

Also a reasonable defensive change. If databases can be undefined transiently, indexing into it will throw. Guarding the access (or using optional chaining) is harmless and prevents a crash. If the app invariant guarantees databases exists, it's unnecessary but not harmful.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/SqlLab/components/SouthPane/Results.tsx
**Line:** 97:97
**Comment:**
	*Null Pointer: Accessing `databases[latestQuery.dbId]` can throw if `databases` is undefined; guard the access so the prop passed to `ResultSet` is undefined when `databases` is missing, preventing a runtime exception.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI finished reviewing your PR.

@codeant-ai-for-open-source
Copy link
Contributor

💡 Enhance Your PR Reviews

We noticed that 3 feature(s) are not configured for this repository. Enabling these features can help improve your code quality and workflow:

🚦 Quality Gates

Status: Quality Gates are not enabled at the organization level
Learn more about Quality Gates

🎫 Jira Ticket Compliance

Status: Jira credentials file not found. Please configure Jira integration in your settings
Learn more about Jira Integration

⚙️ Custom Rules

Status: No custom rules configured. Add rules via organization settings or .codeant/review.json in your repository
Learn more about Custom Rules


Want to enable these features? Contact your organization admin or check our documentation for setup instructions.

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 7, 2026

Code Review Agent Run #66dee5

Actionable Suggestions - 0
Additional Suggestions - 2
  • superset-frontend/src/SqlLab/components/QueryStatusBar/index.tsx - 2
    • Defensive destructuring · Line 158-158
      The addition of ?? {} for destructuring query.extra is a defensive improvement, as other parts of the codebase use optional chaining (e.g., query.extra?.errors), indicating query.extra can be undefined at runtime, preventing potential TypeError.
    • Enum consistency · Line 163-163
      Using QueryState.Fetching enum value instead of string literal 'fetching' improves type safety and consistency with the codebase's enum usage.
Review Details
  • Files reviewed - 7 · Commit Range: 3e6e11c..9c61f11
    • superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx
    • superset-frontend/packages/superset-ui-core/src/query/types/Query.ts
    • superset-frontend/src/SqlLab/actions/sqlLab.ts
    • superset-frontend/src/SqlLab/components/QueryStatusBar/QueryStatusBar.test.tsx
    • superset-frontend/src/SqlLab/components/QueryStatusBar/index.tsx
    • superset-frontend/src/SqlLab/components/ResultSet/index.tsx
    • superset-frontend/src/SqlLab/components/SouthPane/Results.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@apache apache deleted a comment from codeant-ai-for-open-source bot Jan 7, 2026
@apache apache deleted a comment from codeant-ai-for-open-source bot Jan 7, 2026
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 7, 2026

Code Review Agent Run #7fcee6

Actionable Suggestions - 0
Review Details
  • Files reviewed - 8 · Commit Range: 9c61f11..05f776f
    • superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx
    • superset-frontend/packages/superset-ui-core/src/query/types/Query.ts
    • superset-frontend/src/SqlLab/actions/sqlLab.ts
    • superset-frontend/src/SqlLab/components/QueryStatusBar/QueryStatusBar.test.tsx
    • superset-frontend/src/SqlLab/components/QueryStatusBar/index.tsx
    • superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx
    • superset-frontend/src/SqlLab/components/ResultSet/index.tsx
    • superset-frontend/src/SqlLab/components/SouthPane/Results.tsx
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@pull-request-size pull-request-size bot removed the size/L label Jan 7, 2026
@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 7, 2026

Code Review Agent Run #51a851

Actionable Suggestions - 0
Review Details
  • Files reviewed - 8 · Commit Range: 05f776f..5a509e4
    • superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx
    • superset-frontend/packages/superset-ui-core/src/query/types/Query.ts
    • superset-frontend/src/SqlLab/actions/sqlLab.ts
    • superset-frontend/src/SqlLab/components/QueryStatusBar/QueryStatusBar.test.tsx
    • superset-frontend/src/SqlLab/components/QueryStatusBar/index.tsx
    • superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx
    • superset-frontend/src/SqlLab/components/ResultSet/index.tsx
    • superset-frontend/src/SqlLab/components/SouthPane/Results.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@justinpark
Copy link
Member Author

cc: @kasiazjc for design feedback

@apache apache deleted a comment from codeant-ai-for-open-source bot Jan 7, 2026
@apache apache deleted a comment from codeant-ai-for-open-source bot Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages size/XL sqllab Namespace | Anything related to the SQL Lab

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant