Skip to content

Commit b2a2931

Browse files
feat(api): api update (#61)
1 parent d2fde2c commit b2a2931

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 82
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-399721aa7320dd4c054617336d4503f88c99aee4a919c9ec5beddcef25d1bbbc.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-3c62dd0cce4685c5729cd6853a965389db50faf0f1ee6ed058d9bfbb6b2df9a9.yml

src/asktable/resources/datasources/datasources.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ def with_streaming_response(self) -> DatasourcesResourceWithStreamingResponse:
9494
def create(
9595
self,
9696
*,
97-
engine: Literal[
98-
"mysql", "mysql57", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"
99-
],
97+
engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"],
10098
async_process_meta: bool | NotGiven = NOT_GIVEN,
10199
value_index: bool | NotGiven = NOT_GIVEN,
102100
access_config: Optional[datasource_create_params.AccessConfig] | NotGiven = NOT_GIVEN,
@@ -430,9 +428,7 @@ def with_streaming_response(self) -> AsyncDatasourcesResourceWithStreamingRespon
430428
async def create(
431429
self,
432430
*,
433-
engine: Literal[
434-
"mysql", "mysql57", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"
435-
],
431+
engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"],
436432
async_process_meta: bool | NotGiven = NOT_GIVEN,
437433
value_index: bool | NotGiven = NOT_GIVEN,
438434
access_config: Optional[datasource_create_params.AccessConfig] | NotGiven = NOT_GIVEN,

src/asktable/types/datasource.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class AccessConfig(BaseModel):
1616
db: Optional[str] = None
1717
"""数据库引擎可以管理多个数据库,此参数用于指定数据库名称"""
1818

19+
db_version: Optional[str] = None
20+
"""数据库版本"""
21+
1922
host: Optional[str] = None
2023
"""数据库地址"""
2124

@@ -48,9 +51,7 @@ class Datasource(BaseModel):
4851
created_at: datetime
4952
"""创建时间"""
5053

51-
engine: Literal[
52-
"mysql", "mysql57", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"
53-
]
54+
engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
5455
"""数据源引擎"""
5556

5657
meta_status: Literal["processing", "failed", "success", "unprocessed"]

src/asktable/types/datasource_create_params.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
class DatasourceCreateParams(TypedDict, total=False):
1212
engine: Required[
13-
Literal[
14-
"mysql", "mysql57", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"
15-
]
13+
Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
1614
]
1715
"""数据源引擎"""
1816

@@ -34,6 +32,9 @@ class AccessConfig(TypedDict, total=False):
3432
db: Optional[str]
3533
"""数据库引擎可以管理多个数据库,此参数用于指定数据库名称"""
3634

35+
db_version: Optional[str]
36+
"""数据库版本"""
37+
3738
host: Optional[str]
3839
"""数据库地址"""
3940

src/asktable/types/datasource_update_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ class AccessConfig(TypedDict, total=False):
4444
db: Optional[str]
4545
"""数据库引擎可以管理多个数据库,此参数用于指定数据库名称"""
4646

47+
db_version: Optional[str]
48+
"""数据库版本"""
49+
4750
host: Optional[str]
4851
"""数据库地址"""
4952

tests/api_resources/test_datasources.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
3636
access_config={
3737
"atst_link_id": "atst_link_123456",
3838
"db": "test",
39+
"db_version": "5.7",
3940
"host": "192.168.0.10",
4041
"location_type": "local",
4142
"location_url": "http://example.com/data.csv",
@@ -126,6 +127,7 @@ def test_method_update_with_all_params(self, client: Asktable) -> None:
126127
access_config={
127128
"atst_link_id": "atst_link_123456",
128129
"db": "test",
130+
"db_version": "5.7",
129131
"host": "192.168.0.10",
130132
"location_type": "local",
131133
"location_url": "http://example.com/data.csv",
@@ -311,6 +313,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
311313
access_config={
312314
"atst_link_id": "atst_link_123456",
313315
"db": "test",
316+
"db_version": "5.7",
314317
"host": "192.168.0.10",
315318
"location_type": "local",
316319
"location_url": "http://example.com/data.csv",
@@ -401,6 +404,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable)
401404
access_config={
402405
"atst_link_id": "atst_link_123456",
403406
"db": "test",
407+
"db_version": "5.7",
404408
"host": "192.168.0.10",
405409
"location_type": "local",
406410
"location_url": "http://example.com/data.csv",

0 commit comments

Comments
 (0)