-
Notifications
You must be signed in to change notification settings - Fork 16.5k
fix: streaming export losing g context #36950
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
fix: streaming export losing g context #36950
Conversation
|
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 · |
Nitpicks 🔍
|
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this 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 #65a420
Actionable Suggestions - 1
-
superset/commands/streaming_export/base.py - 1
- Blind exception catch too broad · Line 240-240
Review Details
-
Files reviewed - 1 · Commit Range:
37119f9..37119f9- superset/commands/streaming_export/base.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 [email protected].
Documentation & Help
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #36950 +/- ##
===========================================
+ Coverage 0 68.17% +68.17%
===========================================
Files 0 639 +639
Lines 0 47665 +47665
Branches 0 5205 +5205
===========================================
+ Hits 0 32494 +32494
- Misses 0 13891 +13891
- Partials 0 1280 +1280
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The app context is discarded after the generator finishes, so cleaning up g attributes is unnecessary. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Capture flask.g attributes right before creating the generator rather than at command construction time. This is closer to when we actually need the data and avoids holding onto g state longer than necessary. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
3d4cf23 to
cf3d135
Compare
Code Review Agent Run #8fd3f4Actionable Suggestions - 0Review 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 |
amaannawab923
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ! LGTM !
Co-authored-by: Claude Opus 4.5 <[email protected]>
SUMMARY
Streaming CSV exports create a new Flask app context when the generator runs, which causes
flask.gattributes from the original request to be lost. This can break functionality that relies on request-scoped data stored ing.This fix:
flask.gattributes when the command is initialized (during the original request context)preserve_g_context()when the generator executes in the new app contextBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A - backend change
TESTING INSTRUCTIONS
pytest tests/unit_tests/commands/sql_lab/streaming_export_command_test.py -vADDITIONAL INFORMATION