Skip to content

Fix 500 when creating text widgets without visualization_id - #7796

Open
amirshahzadhashmi7145 wants to merge 1 commit into
getredash:masterfrom
amirshahzadhashmi7145:fix/7793-text-widget-missing-visualization-id
Open

amirshahzadhashmi7145 wants to merge 1 commit into
getredash:masterfrom
amirshahzadhashmi7145:fix/7793-text-widget-missing-visualization-id

Conversation

@amirshahzadhashmi7145

@amirshahzadhashmi7145 amirshahzadhashmi7145 commented Sep 3, 2026

Copy link
Copy Markdown

Summary

Test plan

  • POST /api/widgets with {dashboard_id, width, text} (no visualization_id) returns 200
  • Same request with "visualization_id": null still returns 200
  • Creating a visualization widget still works

Review in cubic

@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown

Greptile Summary

The PR prevents text-widget creation from failing when visualization_id is omitted.

  • Defaults an absent visualization_id to None, matching the existing explicit-null behavior.
  • Adds handler coverage for creating a text widget without the key.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
redash/handlers/widgets.py Safely treats an omitted visualization identifier like the already-supported explicit-null case.
tests/handlers/test_widgets.py Adds focused regression coverage for text-widget creation without visualization_id.

Reviews (3): Last reviewed commit: "Fix 500 when creating a text widget with..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 2 files

Re-trigger cubic

@amirshahzadhashmi7145
amirshahzadhashmi7145 force-pushed the fix/7793-text-widget-missing-visualization-id branch from a221ffa to 365d5ef Compare September 3, 2026 12:33
POST /api/widgets treated a missing visualization_id as a KeyError instead of a text widget.

Co-authored-by: Cursor <cursoragent@cursor.com>
@amirshahzadhashmi7145
amirshahzadhashmi7145 force-pushed the fix/7793-text-widget-missing-visualization-id branch from 365d5ef to 7bd1f33 Compare September 6, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WidgetListResource.post() raises unhandled KeyError (500) when visualization_id is omitted for text widgets

1 participant