Skip to content

fix(reports): export full paginated table results - #44218

Merged
aminghadersohi merged 3 commits into
apache:masterfrom
aminghadersohi:sc-119162-mcp-excel-pagination
Sep 28, 2026
Merged

aminghadersohi merged 3 commits into
apache:masterfrom
aminghadersohi:sc-119162-mcp-excel-pagination

Conversation

@aminghadersohi

@aminghadersohi aminghadersohi commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

SUMMARY

Extracts self-contained documentation and regression coverage for dashboard Excel pagination from #43771 so that the Sunburst feature PR has a smaller, more reviewable scope.

The backend already rebuilds a saved paginated Table as one full-limit query instead of the interactive page and row-count pair. This PR documents and locks in that behavior through the real schema/ChartDataCommand path, including resetting a nonzero input offset, and removes an ineffective form_data.result_format assignment.

This change is independent of Sunburst and can land before #43771. The other independent extraction is #44219. Once merged, #43771 can absorb master normally and its corresponding diff disappears without rewriting either branch.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Not applicable; backend export behavior only.

TESTING INSTRUCTIONS

PYTHONPATH="$PWD/superset-core/src:$PYTHONPATH" pytest -q tests/unit_tests/tasks/test_export_dashboard_excel.py
# 49 passed

pre-commit run
# Passed for all staged files.

Regression coverage verifies aggregate and raw paginated Tables export the configured 1,000-row limit rather than a 10-row interactive page, reset the offset, and omit the count query.

Exact-head CI: 1714632f9541a2220cc1edf17bad4608b6b6cecf is mergeable. Focused tests and pre-commit pass; integration checks are blocked by the two migration heads present on the current master merge result (c7f53d184ea2 and 88a01c781622).

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

@bito-code-review

bito-code-review Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #cc7dad

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset/tasks/export_dashboard_excel.py - 1
    • Ineffective result_format override · Line 237-237
      Setting `result_format` inside `form_data` has no effect on the export: `build_query_context_from_form_data` never reads it, and `_write_chart_sheets` unconditionally overrides the payload's top-level `result_format` to `ChartDataResultFormat.JSON` (line 300) before `ChartDataCommand` runs. If the goal is full non-paginated results, set the top-level `result_format`/`result_type` on the returned payload or strip `server_pagination`/`is_rowcount`/`row_offset` from the built query.
Review Details
  • Files reviewed - 3 · Commit Range: ffaa21d..ffaa21d
    • docs/docs/using-superset/exporting-dashboard-data.mdx
    • superset/tasks/export_dashboard_excel.py
    • tests/unit_tests/tasks/test_export_dashboard_excel.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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 an incremental AI Review.

  • /review full - 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

@github-actions github-actions Bot added the doc Namespace | Anything related to documentation label Sep 14, 2026
@netlify

netlify Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit f3764bb
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6ab4318ce42dc00008568896
😎 Deploy Preview https://deploy-preview-44218--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@codecov

codecov Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.06%. Comparing base (d7a918b) to head (f3764bb).
⚠️ Report is 54 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #44218   +/-   ##
=======================================
  Coverage   81.06%   81.06%           
=======================================
  Files        2955     2955           
  Lines      178300   178300           
  Branches    41307    41307           
=======================================
  Hits       144533   144533           
  Misses      31056    31056           
  Partials     2711     2711           
Flag Coverage Δ
hive 36.80% <ø> (ø)
mysql 55.97% <ø> (-0.01%) ⬇️
postgres 55.97% <ø> (-0.01%) ⬇️
presto 38.72% <ø> (ø)
python 85.36% <ø> (ø)
sqlite 55.69% <ø> (ø)
unit 77.62% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

@EnxDev EnxDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the current diff and traced the rebuilt query through the Excel export task. All 49 tests in tests/unit_tests/tasks/test_export_dashboard_excel.py pass at 9a07679. I didn't find any blocking issues. One small test suggestion below.

The current diff only adds documentation and regression coverage; the backend already builds a single full-limit query. Could we update the PR summary to reflect that scope?

Comment thread tests/unit_tests/tasks/test_export_dashboard_excel.py
@bito-code-review

Copy link
Copy Markdown
Contributor

The suggestion to use a nonzero row_offset in the test case is appropriate. Using a nonzero value, such as 20, would effectively verify that the implementation correctly passes the offset through to the query context, rather than defaulting to 0 or ignoring the input. This improves the test's robustness by ensuring that pagination parameters are handled accurately.

tests/unit_tests/tasks/test_export_dashboard_excel.py

# ... existing setup ...
    payload = mocks["ChartDataQueryContextSchema"].return_value.load.call_args.args[0]
    # ...
    query = payload["queries"][0]
    assert query["row_limit"] == 1000
    assert query.get("row_offset", 0) == 20
    assert not query.get("is_rowcount")

@bito-code-review

bito-code-review Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #ab7165

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: ffaa21d..9a07679
    • superset/tasks/export_dashboard_excel.py
    • tests/unit_tests/tasks/test_export_dashboard_excel.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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 an incremental AI Review.

  • /review full - 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

@EnxDev EnxDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Second pass complete at 1714632. Thanks for adding the nonzero offset; that addresses my earlier suggestion. I checked the aggregate/raw query construction, pagination handling, and the downstream defaults, and ran the export-task and shared query-builder suites together: 89 tests passed. I didn't find any additional code issues.

One wording detail in the summary: ChartDataQueryContextSchema and ChartDataCommand are mocked in this test, so it verifies the payload handed to them, rather than actual schema loading or database execution. Also, the current diff has no production-code changes, so the reference to removing the form_data.result_format assignment can be dropped.

@bito-code-review

bito-code-review Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #733d03

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 9a07679..1714632
    • tests/unit_tests/tasks/test_export_dashboard_excel.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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 an incremental AI Review.

  • /review full - 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

@EnxDev EnxDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@rusackas
rusackas force-pushed the sc-119162-mcp-excel-pagination branch from 1714632 to f3764bb Compare September 23, 2026 20:07
@bito-code-review

bito-code-review Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #e039f7

Actionable Suggestions - 0
Additional Suggestions - 1
  • tests/unit_tests/tasks/test_export_dashboard_excel.py - 1
    • Missing local type hints · Line 1477-1502
      New test locals `form_data`, `chart`, `payload`, `query` lack explicit type annotations, contrary to the repo's typing rules for test files (BITO adaptive rules 13153/13598). Add annotations (e.g. `form_data: dict[str, Any]`, `query: dict[str, Any]`).
Review Details
  • Files reviewed - 2 · Commit Range: 1156889..f3764bb
    • docs/docs/using-superset/exporting-dashboard-data.mdx
    • tests/unit_tests/tasks/test_export_dashboard_excel.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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 an incremental AI Review.

  • /review full - 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

@aminghadersohi
aminghadersohi merged commit ffe9a00 into apache:master Sep 28, 2026
76 checks passed
villebro pushed a commit that referenced this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Namespace | Anything related to documentation size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants