fix(reports): export server-paginated table row limits#41103
fix(reports): export server-paginated table row limits#41103innovark37 wants to merge 5 commits into
Conversation
|
The flagged issue is correct. The newly introduced methods To resolve this, you should add docstrings to both methods. Here is the suggested implementation: def _get_chart_data_request_payload(
self,
result_format: ChartDataResultFormat,
) -> dict[str, Any]:
"""
Build the POST payload for chart data export.
:param result_format: The desired format for the chart data.
:return: A dictionary representing the request payload.
:raises ReportScheduleExecuteUnexpectedError: If the query context is invalid.
"""
# ... existing implementation ...
@staticmethod
def _post_chart_data(
chart_url: str,
auth_cookies: Optional[dict[str, str]],
request_payload: dict[str, Any],
) -> Optional[bytes]:
"""
POST the chart data request to the provided URL.
:param chart_url: The URL to send the POST request to.
:param auth_cookies: Authentication cookies for the request.
:param request_payload: The payload to send.
:return: The response content as bytes, or None if no cookies provided.
:raises URLError: If the request fails.
"""
# ... existing implementation ...I have checked the PR comments, and there are no other actionable suggestions or comments to address at this time. Would you like me to proceed with any other tasks? superset/commands/report/execute.py |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #41103 +/- ##
==========================================
- Coverage 64.32% 56.19% -8.13%
==========================================
Files 2652 2652
Lines 144728 144780 +52
Branches 33384 33394 +10
==========================================
- Hits 93090 81357 -11733
- Misses 49985 62697 +12712
+ Partials 1653 726 -927
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:
|
There was a problem hiding this comment.
Code Review Agent Run #dc034c
Actionable Suggestions - 2
-
superset/commands/report/execute.py - 2
- Missing unit tests for new method · Line 512-562
- Silent failure on missing auth · Line 570-571
Additional Suggestions - 1
-
superset/commands/report/execute.py - 1
-
Missing docstring and timeout · Line 565-590The `_post_chart_data()` method lacks a docstring. Per BITO.md rule 12147, all new Python functions must include inline documentation. Additionally, the HTTP request has no timeout, which could cause report generation to hang indefinitely if the API is unresponsive.
-
Filtered by Review Rules
Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
-
superset/commands/report/execute.py - 1
- URL scheme audit needed · Line 577-577
Review Details
-
Files reviewed - 2 · Commit Range:
d9fc509..d9fc509- superset/commands/report/execute.py
- tests/unit_tests/commands/report/execute_test.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
Code Review Agent Run #5bb637Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Scheduled report CSV/XLSX exports for Table charts with server-side pagination used the saved chart query context from the preview path. That query context contains the current page data query, where
row_limitis based on Server Page Length, not the configured Row limit.This made report exports behave differently from frontend exports:
row_offset = 0.is_rowcountquery, which is useful for the table preview but unnecessary for file export.This change makes the report worker send chart data requests using the same payload shape as frontend downloads. For server-paginated table exports, the worker prepares the saved query context for export by:
row_limitfromform_data.row_limit;row_offsetto0;is_rowcountquery;result_formatset to CSV/XLSX andresult_typeset to post-processed.Alternative considered: normalize this on the chart data backend instead of in the worker. For example:
That would make the rule closer to the chart data execution layer, but it would also affect all POST callers of the chart data API. The worker-level change keeps the behavior scoped to scheduled report exports and avoids changing the public chart data API contract.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable. This is a backend report export fix.
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
ALERT_REPORTS