SIGN IN SIGN UP
apache / superset UNCLAIMED

Apache Superset is a Data Visualization and Data Exploration Platform

0 0 151 TypeScript

refactor(explore): simplify form_data parse + add no-datasource regression

/review-code on the post-round-5 slice flagged two minor issues genuinely
introduced by 89919a1c96:

* `loads_request_json` already swallows `TypeError`/`JSONDecodeError` and
  returns `{}`, so the explicit `try/except ValueError` wrapping it was
  dead defensive code. Replace it with an `isinstance(..., dict)` guard
  — that also closes the pre-existing `?form_data=42` edge case where a
  non-dict top-level JSON value would `AttributeError` on `.get()`.

* The no-datasource fall-through path (the loop the fix unblocked) had
  no targeted regression test. `test_slices` and
  `test_slice_id_is_always_logged_correctly_on_web_request` exercised
  it only indirectly via `Slice.slice_url`. Add a sibling to
  `test_explore_redirect` that asserts `/explore/?form_data={"slice_id":1}`
  returns 200 (SPA render), not 302.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
J
Joe Li committed
8a609fd83d23bed8d0fff48d5679b3724fba895c
Parent: ec7e76e