feat(SIP-95): new endpoint for table metadata (#28122)

This commit is contained in:
Beto Dealmeida
2024-04-25 12:23:49 -04:00
committed by GitHub
parent 52f8734662
commit 6cf681df68
71 changed files with 1048 additions and 513 deletions

View File

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