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

   <!-- Bito Reply -->
   The review suggestion is valid. Pydantic's default `bool` coercion can 
indeed silently convert truthy or falsy strings (like "false") or numbers (like 
0) into boolean values, which may lead to unintended filtering behavior in the 
MCP tool. To enforce strict validation, you should use `StrictBool` from 
`pydantic` instead of `bool` for the `certified` field.
   
   Would you like me to implement this change for the `certified` field in both 
`superset/mcp_service/chart/schemas.py` and 
`superset/mcp_service/dataset/schemas.py`? If you agree, I can also check the 
rest of the PR for similar issues.
   
   **superset/mcp_service/chart/schemas.py**
   ```
   from pydantic import Field, StrictBool
   
       certified: Annotated[
           StrictBool | None,
           Field(
               default=None,
               description=(
                   "Filter by governance certification status. Use true to 
return "
                   "only certified charts (preferred when selecting governed "
                   "assets), false to return only uncertified charts, or omit 
to "
                   "return both (default)."
               ),
           ),
       ]
   ```


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