Skip to content

Commit fabff6d

Browse files
feat(api): api update (#190)
1 parent 696b007 commit fabff6d

File tree

6 files changed

+29
-6
lines changed

6 files changed

+29
-6
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 96
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-a4c91d7713c87ff56f393709ecda79c31ce7ceee1507b9421fb92da28489a073.yml
3-
openapi_spec_hash: 57b85e9e6909c8901b30249ac2d8bfa0
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-89441bb57f08015241a214ce4e51c76bac21e202f1f9cdc0a90e91c4ccbe4ff0.yml
3+
openapi_spec_hash: 2642d0ba1cbd7daa3dd69af0d3076a26
44
config_hash: 575ddfb316392e5f7f3c7b7999796a03
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Dict, List
4+
from typing_extensions import Literal
45

56
from .._models import BaseModel
67

7-
__all__ = ["DatasourceRetrieveRuntimeMetaResponse"]
8+
__all__ = ["DatasourceRetrieveRuntimeMetaResponse", "Schema"]
9+
10+
11+
class Schema(BaseModel):
12+
name: str
13+
"""表名称数据"""
14+
15+
type: Literal["table", "view"]
16+
"""表的类型"""
817

918

1019
class DatasourceRetrieveRuntimeMetaResponse(BaseModel):
11-
schemas: Dict[str, List[str]]
20+
schemas: Dict[str, List[Schema]]
1221
"""元数据"""

src/asktable/types/datasources/meta_create_params.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Dict, List, Optional
6-
from typing_extensions import Required, TypedDict
6+
from typing_extensions import Literal, Required, TypedDict
77

88
__all__ = ["MetaCreateParams", "Meta", "MetaSchemas", "MetaSchemasTables", "MetaSchemasTablesFields"]
99

@@ -44,6 +44,9 @@ class MetaSchemasTables(TypedDict, total=False):
4444

4545
fields: Dict[str, MetaSchemasTablesFields]
4646

47+
table_type: Literal["table", "view"]
48+
"""table type"""
49+
4750

4851
class MetaSchemas(TypedDict, total=False):
4952
name: Required[str]

src/asktable/types/datasources/meta_update_params.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Dict, List, Optional
6-
from typing_extensions import Required, TypedDict
6+
from typing_extensions import Literal, Required, TypedDict
77

88
__all__ = ["MetaUpdateParams", "Meta", "MetaSchemas", "MetaSchemasTables", "MetaSchemasTablesFields"]
99

@@ -42,6 +42,9 @@ class MetaSchemasTables(TypedDict, total=False):
4242

4343
fields: Dict[str, MetaSchemasTablesFields]
4444

45+
table_type: Literal["table", "view"]
46+
"""table type"""
47+
4548

4649
class MetaSchemas(TypedDict, total=False):
4750
name: Required[str]

src/asktable/types/meta.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from typing import Dict, Optional
44
from datetime import datetime
5+
from typing_extensions import Literal
56

67
from .._models import BaseModel
78

@@ -58,6 +59,9 @@ class SchemasTables(BaseModel):
5859
origin_desc: str
5960
"""table description from database"""
6061

62+
table_type: Optional[Literal["table", "view"]] = None
63+
"""table type"""
64+
6165

6266
class Schemas(BaseModel):
6367
curr_desc: str

tests/api_resources/datasources/test_meta.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
4949
"visibility": True,
5050
}
5151
},
52+
"table_type": "table",
5253
}
5354
},
5455
}
@@ -158,6 +159,7 @@ def test_method_update_with_all_params(self, client: Asktable) -> None:
158159
"visibility": True,
159160
}
160161
},
162+
"table_type": "table",
161163
}
162164
},
163165
}
@@ -276,6 +278,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
276278
"visibility": True,
277279
}
278280
},
281+
"table_type": "table",
279282
}
280283
},
281284
}
@@ -385,6 +388,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable)
385388
"visibility": True,
386389
}
387390
},
391+
"table_type": "table",
388392
}
389393
},
390394
}

0 commit comments

Comments
 (0)