Files
superset2/superset/common/query_context_processor.py
Claude Code 1894b77b44 fix(bigquery): address review comments on memory-limited fetch
- Use has_app_context()/has_request_context() guards so fetch_data
  is safe to call outside a Flask request (fixes RuntimeError on g
  writes and current_app access in non-request paths)
- Replace sys.getsizeof(str(batch)) with per-row getsizeof sum for
  more accurate memory estimation without the str() allocation
- Fix false-positive truncation: fetch remaining+1 rows and check
  len > remaining to confirm more data exists beyond the cap
- Reset g.bq_memory_limited/g.bq_memory_limited_row_count after
  reading in get_df_payload to prevent flag leaking across multiple
  queries in the same request
- Wrap warning string in _() for i18n
- Add warning field to ChartDataResponseResult Marshmallow schema
- Pass noDuplicate: true to addWarningToast to suppress duplicate
  toasts when a multi-query chart has multiple truncated responses

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 13:16:58 -07:00

22 KiB