mirror of
https://github.com/apache/superset.git
synced 2026-04-26 11:34:27 +00:00
feat(SIP-95): new endpoint for table metadata (#28122)
This commit is contained in:
@@ -14,7 +14,10 @@
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from typing import Any, Optional
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from superset.models.core import Database
|
||||
|
||||
@@ -25,9 +28,9 @@ class SQLValidationAnnotation: # pylint: disable=too-few-public-methods
|
||||
def __init__(
|
||||
self,
|
||||
message: str,
|
||||
line_number: Optional[int],
|
||||
start_column: Optional[int],
|
||||
end_column: Optional[int],
|
||||
line_number: int | None,
|
||||
start_column: int | None,
|
||||
end_column: int | None,
|
||||
):
|
||||
self.message = message
|
||||
self.line_number = line_number
|
||||
@@ -52,7 +55,11 @@ class BaseSQLValidator: # pylint: disable=too-few-public-methods
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls, sql: str, schema: Optional[str], database: Database
|
||||
cls,
|
||||
sql: str,
|
||||
catalog: str | None,
|
||||
schema: str | None,
|
||||
database: Database,
|
||||
) -> list[SQLValidationAnnotation]:
|
||||
"""Check that the given SQL querystring is valid for the given engine"""
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in New Issue
Block a user