SIGN IN SIGN UP
apache / superset UNCLAIMED

Apache Superset is a Data Visualization and Data Exploration Platform

0 0 150 TypeScript

fix(subdirectory): avoid explore redirect loop when form_data has no datasource

CI 25898464041 (Python-Integration, postgres + mysql) failed
`test_slices` and `test_slice_id_is_always_logged_correctly_on_web_request`
with werkzeug.test.ClientRedirectError: Loop detected: A 302 redirect to
/explore/?slice_id=216&form_data={"slice_id": 216} was already made.

`Slice.slice_url` builds /explore/?slice_id=X&form_data={"slice_id": X},
i.e. no datasource. The ExploreView.root redirect added in d8335c0e1b
fires unconditionally when form_data is present, but
Superset.get_redirect_url() only rewrites the URL when
parsed_form_data["datasource"] exists (the form_data → form_data_key
caching path is gated on a datasource). Without one, the redirect target
equals the source and the test client follows itself in circles.

Fix: pre-parse form_data and only delegate to get_redirect_url when a
datasource is present; otherwise fall through to render_app_template.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
J
Joe Li committed
89919a1c96a12c0b4bac15ff24eded415a42ec70
Parent: 9389a2a