Skip to content

Conversation

@justinpark
Copy link
Member

@justinpark justinpark commented Jan 6, 2026

User description

SUMMARY

In addition to the existing query states, Trino provides additional statuses—queued and planning—during the running state. This commit includes this information in progress_text to provide more detailed status updates about the running state on the frontend.

TESTING INSTRUCTIONS

specs

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 Description

Show Trino queued/planning status in query progress and return readable progress text

What Changed

  • SQL Lab now shows human-readable running states for Trino queries: "Planning execution" when planning and "Awaiting execution" when queued
  • Query results and API responses include a new progressText field so clients and the UI receive these running-state messages
  • The query record only updates in the database when progress or progress text actually change, reducing redundant writes

Impact

✅ Clearer Trino running-state messages in SQL Lab
✅ Progress text visible in query results API
✅ Fewer redundant database updates during query polling

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 6, 2026

Code Review Agent Run #0df76f

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 574fb14..574fb14
    • superset/db_engine_specs/trino.py
    • superset/models/sql_lab.py
    • superset/sqllab/schemas.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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 data:connect:trino Related to Trino label Jan 6, 2026
@codeant-ai-for-open-source codeant-ai-for-open-source bot added the size:S This PR changes 10-29 lines, ignoring generated files label Jan 6, 2026
@codeant-ai-for-open-source
Copy link
Contributor

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Tests / Backwards compatibility
    There are no tests included that assert the new column is persisted and serialized. Add unit/integration tests ensuring the column is present, nullable behavior is correct, and the frontend/API surfaces the expected values. Also validate any core/shared models or type definitions that might need updates.

  • DB Migration
    A new ORM column progress_text was added to the query model. This requires an Alembic migration to add the column to the query table (and a downgrade that drops it). Ensure the migration is created, reviewed, and run on deployments to avoid runtime schema mismatches.

  • Serialization compatibility
    The new progressText field is added to Query.to_dict(). Verify API contracts and frontend consumers handle null/empty values correctly. Consider normalizing the value (e.g., empty string) or documenting the new field in API schemas so clients don't break on unexpected nulls.

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

CodeAnt AI finished reviewing your PR.

@apache apache deleted a comment from codeant-ai-for-open-source bot Jan 6, 2026
@justinpark justinpark force-pushed the chore--add-extra-trino-cursor-process-text branch from 574fb14 to 3115824 Compare January 7, 2026 05:14
@pull-request-size pull-request-size bot added size/L and removed size/S labels 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

@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

❌ Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.16%. Comparing base (76d897e) to head (3115824).
⚠️ Report is 3264 commits behind head on master.

Files with missing lines Patch % Lines
superset/db_engine_specs/trino.py 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #36909      +/-   ##
==========================================
+ Coverage   60.48%   68.16%   +7.67%     
==========================================
  Files        1931      639    -1292     
  Lines       76236    47665   -28571     
  Branches     8568     5206    -3362     
==========================================
- Hits        46114    32492   -13622     
+ Misses      28017    13893   -14124     
+ Partials     2105     1280     -825     
Flag Coverage Δ
hive 43.09% <12.50%> (-6.07%) ⬇️
javascript ?
mysql 66.17% <12.50%> (?)
postgres 66.22% <12.50%> (?)
presto 46.69% <12.50%> (-7.12%) ⬇️
python 68.13% <12.50%> (+4.63%) ⬆️
sqlite 65.93% <12.50%> (?)
unit 100.00% <ø> (+42.36%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@bito-code-review bito-code-review bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #bc3755

Actionable Suggestions - 2
  • tests/unit_tests/db_engine_specs/test_trino.py - 2
Additional Suggestions - 1
  • superset/db_engine_specs/trino.py - 1
    • Missing Type Hints · Line 229-248
      The project standards require type hints for all new Python code. Please add `: bool = False` to the `needs_commit` assignment and `: str` to the `progress_text` assignment to improve maintainability and enable MyPy validation.
Review Details
  • Files reviewed - 2 · Commit Range: 3115824..3115824
    • superset/db_engine_specs/trino.py
    • tests/unit_tests/db_engine_specs/test_trino.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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

TrinoEngineSpec.handle_cursor(cursor=cursor_mock, query=query)

# Check that progress_text was set to "Scheduled" for PLANNING state
assert query.extra.get("progress_text") is not None
Copy link
Contributor

Choose a reason for hiding this comment

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

Weak test assertion for progress_text mapping

The assertion here is too weak—it only checks that progress_text is set, but doesn't verify the correct mapped value for PLANNING state. Since the code sets it to 'Scheduled' for PLANNING, the test should assert equality to catch mapping errors.

Code suggestion
Check the AI-generated fix before applying
 --- a/tests/unit_tests/db_engine_specs/test_trino.py
 +++ b/tests/unit_tests/db_engine_specs/test_trino.py
 @@ -1259,7 +1259,7 @@ def test_handle_cursor_sets_progress_text_for_planning_state(
      # Check that progress_text was set to "Scheduled" for PLANNING state
 -    assert query.extra.get("progress_text") is not None
 +    assert query.extra.get("progress_text") == "Scheduled"

Code Review Run #bc3755


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

TrinoEngineSpec.handle_cursor(cursor=cursor_mock, query=query)

# Check that progress_text was set
assert query.extra.get("progress_text") is not None
Copy link
Contributor

Choose a reason for hiding this comment

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

Weak test assertion for progress_text mapping

Similar to the PLANNING test, this assertion is too weak—it doesn't verify the correct 'Queued' value for QUEUED state, potentially missing mapping bugs.

Code suggestion
Check the AI-generated fix before applying
 --- a/tests/unit_tests/db_engine_specs/test_trino.py
 +++ b/tests/unit_tests/db_engine_specs/test_trino.py
 @@ -1303,7 +1303,7 @@ def test_handle_cursor_sets_progress_text_for_queued_state(
      # Check that progress_text was set
 -    assert query.extra.get("progress_text") is not None
 +    assert query.extra.get("progress_text") == "Queued"

Code Review Run #bc3755


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:connect:trino Related to Trino size/L size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant