bito-code-review[bot] commented on PR #43478:
URL: https://github.com/apache/superset/pull/43478#issuecomment-5399470371

   <!-- Bito Reply -->
   The flagged issue is correct. In `_sql_from_saved_query_context`, the 
`try-except` block catches errors during the merging of `extra_form_data` and 
returns an error message starting with `Invalid extra_form_data filter`. 
However, the test `test_malformed_extra_form_data_filter_returns_clean_error` 
asserts that the error message contains `Invalid chart query data`, which is 
the message returned by the fallback path (`_sql_from_form_data`), not the 
saved-context path. To resolve this, update the test assertion to expect 
`Invalid extra_form_data filter` when testing the saved-context path, or adjust 
the production code if the fallback message is intended.
   
   **tests/unit_tests/mcp_service/chart/tool/test_get_chart_sql.py**
   ```
   data = result.structured_content.get("result", result.structured_content)
               assert data["error_type"] == "ValidationError"
               assert "Invalid extra_form_data filter" in data["error"]
   ```


-- 
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