From dd0cefbf979d7ec57f0a1382fd2d6ca972172de2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 09:14:50 +0000 Subject: [PATCH] feat(api): api update --- .stats.yml | 4 ++-- .../datasource_retrieve_runtime_meta_response.py | 13 +++++++++++-- .../types/datasources/meta_create_params.py | 5 ++++- .../types/datasources/meta_update_params.py | 5 ++++- src/asktable/types/meta.py | 4 ++++ tests/api_resources/datasources/test_meta.py | 4 ++++ 6 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index c7d9dd7b..cbd13d7f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 96 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-a4c91d7713c87ff56f393709ecda79c31ce7ceee1507b9421fb92da28489a073.yml -openapi_spec_hash: 57b85e9e6909c8901b30249ac2d8bfa0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-89441bb57f08015241a214ce4e51c76bac21e202f1f9cdc0a90e91c4ccbe4ff0.yml +openapi_spec_hash: 2642d0ba1cbd7daa3dd69af0d3076a26 config_hash: 575ddfb316392e5f7f3c7b7999796a03 diff --git a/src/asktable/types/datasource_retrieve_runtime_meta_response.py b/src/asktable/types/datasource_retrieve_runtime_meta_response.py index 4465ecb6..3ddeefcf 100644 --- a/src/asktable/types/datasource_retrieve_runtime_meta_response.py +++ b/src/asktable/types/datasource_retrieve_runtime_meta_response.py @@ -1,12 +1,21 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List +from typing_extensions import Literal from .._models import BaseModel -__all__ = ["DatasourceRetrieveRuntimeMetaResponse"] +__all__ = ["DatasourceRetrieveRuntimeMetaResponse", "Schema"] + + +class Schema(BaseModel): + name: str + """表名称数据""" + + type: Literal["table", "view"] + """表的类型""" class DatasourceRetrieveRuntimeMetaResponse(BaseModel): - schemas: Dict[str, List[str]] + schemas: Dict[str, List[Schema]] """元数据""" diff --git a/src/asktable/types/datasources/meta_create_params.py b/src/asktable/types/datasources/meta_create_params.py index 5684c17b..864118fc 100644 --- a/src/asktable/types/datasources/meta_create_params.py +++ b/src/asktable/types/datasources/meta_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["MetaCreateParams", "Meta", "MetaSchemas", "MetaSchemasTables", "MetaSchemasTablesFields"] @@ -44,6 +44,9 @@ class MetaSchemasTables(TypedDict, total=False): fields: Dict[str, MetaSchemasTablesFields] + table_type: Literal["table", "view"] + """table type""" + class MetaSchemas(TypedDict, total=False): name: Required[str] diff --git a/src/asktable/types/datasources/meta_update_params.py b/src/asktable/types/datasources/meta_update_params.py index 997a0110..0fc2d2ce 100644 --- a/src/asktable/types/datasources/meta_update_params.py +++ b/src/asktable/types/datasources/meta_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["MetaUpdateParams", "Meta", "MetaSchemas", "MetaSchemasTables", "MetaSchemasTablesFields"] @@ -42,6 +42,9 @@ class MetaSchemasTables(TypedDict, total=False): fields: Dict[str, MetaSchemasTablesFields] + table_type: Literal["table", "view"] + """table type""" + class MetaSchemas(TypedDict, total=False): name: Required[str] diff --git a/src/asktable/types/meta.py b/src/asktable/types/meta.py index c7c1877a..6b6a42b6 100644 --- a/src/asktable/types/meta.py +++ b/src/asktable/types/meta.py @@ -2,6 +2,7 @@ from typing import Dict, Optional from datetime import datetime +from typing_extensions import Literal from .._models import BaseModel @@ -58,6 +59,9 @@ class SchemasTables(BaseModel): origin_desc: str """table description from database""" + table_type: Optional[Literal["table", "view"]] = None + """table type""" + class Schemas(BaseModel): curr_desc: str diff --git a/tests/api_resources/datasources/test_meta.py b/tests/api_resources/datasources/test_meta.py index 4b5c86a0..2cc85d2f 100644 --- a/tests/api_resources/datasources/test_meta.py +++ b/tests/api_resources/datasources/test_meta.py @@ -49,6 +49,7 @@ def test_method_create_with_all_params(self, client: Asktable) -> None: "visibility": True, } }, + "table_type": "table", } }, } @@ -158,6 +159,7 @@ def test_method_update_with_all_params(self, client: Asktable) -> None: "visibility": True, } }, + "table_type": "table", } }, } @@ -276,6 +278,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable) "visibility": True, } }, + "table_type": "table", } }, } @@ -385,6 +388,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable) "visibility": True, } }, + "table_type": "table", } }, }