codeant-ai-for-open-source[bot] commented on code in PR #41611: URL: https://github.com/apache/superset/pull/41611#discussion_r3537925596
########## superset/mcp_service/semantic_layer/schemas.py: ########## @@ -0,0 +1,302 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +"""Pydantic schemas for semantic layer MCP tools.""" + +from __future__ import annotations + +from typing import Any, Literal + +from pydantic import BaseModel, Field + +from superset.mcp_service.chart.schemas import DataColumn, PerformanceMetadata +from superset.mcp_service.common.cache_schemas import CacheStatus +from superset.mcp_service.common.error_schemas import MCPBaseError + +# --------------------------------------------------------------------------- +# Shared error schema +# --------------------------------------------------------------------------- + + +class SemanticLayerError(MCPBaseError): + """Error response returned by semantic layer tools.""" + + success: Literal[False] = False + + @classmethod + def create(cls, *, error: str, error_type: str) -> "SemanticLayerError": Review Comment: ✅ **Customized review instruction saved!** **Instruction:** > Do not require explicit type annotations for the `cls` receiver in `.create()` classmethods within `mcp_service/*/schemas.py`; keep these classmethods unannotated for consistency with the rest of the codebase. **Applied to:** - `superset/mcp_service/**/schemas.py` --- 💡 *To manage or update this instruction, visit: [CodeAnt AI Settings](https://app.codeant.ai/org/settings/learnings)* ########## superset/daos/semantic_layer.py: ########## @@ -201,6 +201,40 @@ def validate_update_uniqueness( for c in candidates ) + @classmethod + def find_accessible(cls) -> list[SemanticView]: Review Comment: ✅ **Customized review instruction saved!** **Instruction:** > Do not flag unannotated `cls` parameters on Python classmethods; this codebase intentionally leaves `cls` unannotated for consistency with existing classmethods. **Applied to:** - `**/*.py` --- 💡 *To manage or update this instruction, visit: [CodeAnt AI Settings](https://app.codeant.ai/org/settings/learnings)* -- 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]
