michael-s-molina commented on code in PR #30897:
URL: https://github.com/apache/superset/pull/30897#discussion_r1837326328
##########
superset/views/sql_lab/views.py:
##########
@@ -169,102 +182,118 @@ def put(self, tab_state_id: int) -> FlaskResponse:
if owner_id != get_user_id():
return Response(status=403)
- fields = {k: json.loads(v) for k, v in request.form.to_dict().items()}
- if client_id := fields.get("latest_query_id"):
- query =
db.session.query(Query).filter_by(client_id=client_id).one_or_none()
- if not query:
- return self.json_response({"error": "Bad request"}, status=400)
Review Comment:
This was an additional validation for when a client ID is no longer valid,
which would generate a 500 response due to a foreign key error. Now the logic
will return the same 400 error but without the extra expensive query.
--
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]