dosubot[bot] commented on issue #35682:
URL: https://github.com/apache/superset/issues/35682#issuecomment-3409705785

   <!-- Answer -->
   This looks like a regression introduced between 6.0.0-RC1 and 6.0.0-RC2. The 
SQL formatting toggle in the "View Query" pop-up sends a POST request to 
`/api/v1/sqllab/format_sql` with a JSON payload containing the SQL string and 
the database engine. The backend strictly validates this payload and expects a 
non-empty `sql` field (string) and, optionally, an `engine` field (string or 
null) 
[reference](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/sqllab/api.py).
   
   Recent changes to SQL formatting logic and input validation (notably in PRs 
#30578 and #30350) may have made the backend less tolerant of missing or 
malformed fields, or changed how the frontend retrieves the engine value 
[reference](https://github.com/apache/superset/pull/30578). If the frontend is 
sending an undefined or invalid `engine`, or if the `sql` field is empty or 
missing, the backend will return a 400 error.
   
   To troubleshoot, check the network request payload in your browser's dev 
tools and confirm both `sql` and `engine` are present and valid. If `engine` is 
undefined or the SQL is empty, that's likely the cause. This regression is 
likely due to stricter validation or a frontend change in how the engine is 
fetched from the dataset metadata.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/5f3e7341-b7b2-41ea-aa3d-97bdba61d188?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/5f3e7341-b7b2-41ea-aa3d-97bdba61d188?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/5f3e7341-b7b2-41ea-aa3d-97bdba61d188?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/5f3e7341-b7b2-41ea-aa3d-97bdba61d188?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/5f3e7341-b7b2-41ea-aa3d-97bdba61d188?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/5f3e7341-b7b2-41ea-aa3d-97bdba61d188?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/5f3e7341-b7b2-41ea-aa3d-97bdba61d188?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
 b)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/35682)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to