bito-code-review[bot] commented on code in PR #41624:
URL: https://github.com/apache/superset/pull/41624#discussion_r3506041023
##########
superset/queries/saved_queries/schemas.py:
##########
@@ -14,9 +14,17 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-from marshmallow import fields, Schema
+from flask_babel import lazy_gettext as _
+from marshmallow import fields, Schema, ValidationError
from marshmallow.validate import Length
+
+def validate_label(value: str) -> None:
+ """Reject blank or whitespace-only saved query labels."""
+ if value is None or not value.strip():
+ raise ValidationError(_("Label must not be empty."))
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing unit test coverage</b></div>
<div id="fix">
The `validate_label` function lacks test coverage. Add tests following the
pattern in
`tests/unit_tests/mcp_service/saved_query/tool/test_saved_query_tools.py` to
verify rejection of blank and whitespace-only labels. Rule [11730] requires
comprehensive unit tests for new functionality.
</div>
</div>
<small><i>Code Review Run #a3fe20</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]