Skip to content

Commit 011e884

Browse files
feat(api): api update
1 parent 5b37cda commit 011e884

7 files changed

Lines changed: 33 additions & 23 deletions

File tree

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 42
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini/asktable-175cd543e099cf2001aa98be7434f0172cec4442fbfef4a0910a82ccf169bedc.yml
3-
openapi_spec_hash: 81204c6be46e3f56e3d16ed2115afb9c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini/asktable-5402f8d745bd9c1bf7341174edb713568b456f0c573fac847bae94fafcc87945.yml
3+
openapi_spec_hash: 31facbabd8f7e3fd71be4e5d1ef2cf7b
44
config_hash: acdf4142177ed1932c2d82372693f811

‎src/asktable/resources/datasources/datasources.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def create(
129129
"yashandb",
130130
"gbase8a",
131131
"gaussdbdws",
132-
"bitable",
132+
"bigquery",
133133
"dap",
134134
"duckdb",
135135
"workbook",
@@ -249,7 +249,7 @@ def update(
249249
"yashandb",
250250
"gbase8a",
251251
"gaussdbdws",
252-
"bitable",
252+
"bigquery",
253253
"dap",
254254
"duckdb",
255255
"workbook",
@@ -262,7 +262,7 @@ def update(
262262
sample_questions: Optional[SequenceNotStr[str]] | Omit = omit,
263263
schema_count: Optional[int] | Omit = omit,
264264
sync_error: Optional[Dict[str, object]] | Omit = omit,
265-
sync_status: Optional[Literal["processing", "success", "failed", "warning"]] | Omit = omit,
265+
sync_status: Optional[Literal["queued", "processing", "success", "failed", "warning"]] | Omit = omit,
266266
table_count: Optional[int] | Omit = omit,
267267
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
268268
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -659,7 +659,7 @@ async def create(
659659
"yashandb",
660660
"gbase8a",
661661
"gaussdbdws",
662-
"bitable",
662+
"bigquery",
663663
"dap",
664664
"duckdb",
665665
"workbook",
@@ -779,7 +779,7 @@ async def update(
779779
"yashandb",
780780
"gbase8a",
781781
"gaussdbdws",
782-
"bitable",
782+
"bigquery",
783783
"dap",
784784
"duckdb",
785785
"workbook",
@@ -792,7 +792,7 @@ async def update(
792792
sample_questions: Optional[SequenceNotStr[str]] | Omit = omit,
793793
schema_count: Optional[int] | Omit = omit,
794794
sync_error: Optional[Dict[str, object]] | Omit = omit,
795-
sync_status: Optional[Literal["processing", "success", "failed", "warning"]] | Omit = omit,
795+
sync_status: Optional[Literal["queued", "processing", "success", "failed", "warning"]] | Omit = omit,
796796
table_count: Optional[int] | Omit = omit,
797797
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
798798
# The extra values given here take precedence over values defined on the client or passed to this method.

‎src/asktable/types/datasource.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Datasource(BaseModel):
4848
"yashandb",
4949
"gbase8a",
5050
"gaussdbdws",
51-
"bitable",
51+
"bigquery",
5252
"dap",
5353
"duckdb",
5454
"workbook",
@@ -64,7 +64,7 @@ class Datasource(BaseModel):
6464
project_id: str
6565
"""项目 ID"""
6666

67-
sync_status: Literal["processing", "success", "failed", "warning"]
67+
sync_status: Literal["queued", "processing", "success", "failed", "warning"]
6868
"""同步状态"""
6969

7070
desc: Optional[str] = None

‎src/asktable/types/datasource_create_params.py‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DatasourceCreateParams(TypedDict, total=False):
5050
"yashandb",
5151
"gbase8a",
5252
"gaussdbdws",
53-
"bitable",
53+
"bigquery",
5454
"dap",
5555
"duckdb",
5656
"workbook",
@@ -66,8 +66,8 @@ class DatasourceCreateParams(TypedDict, total=False):
6666

6767

6868
class AccessConfigAccessConfigConnectionCreate(TypedDict, total=False):
69-
host: Required[str]
70-
"""数据库地址"""
69+
credentials: Optional[str]
70+
"""数据库凭证 JSON"""
7171

7272
db: Optional[str]
7373
"""数据库名称"""
@@ -78,10 +78,13 @@ class AccessConfigAccessConfigConnectionCreate(TypedDict, total=False):
7878
extra_config: Optional[Dict[str, object]]
7979
"""额外配置"""
8080

81+
host: Optional[str]
82+
"""数据库地址"""
83+
8184
password: Optional[str]
8285
"""数据库密码"""
8386

84-
port: int
87+
port: Optional[int]
8588
"""数据库端口"""
8689

8790
securetunnel_id: Optional[str]

‎src/asktable/types/datasource_retrieve_response.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717

1818

1919
class AccessConfigAccessConfigConnectionResponse(BaseModel):
20-
host: str
21-
"""数据库地址"""
22-
2320
atst_link_id: Optional[str] = None
2421
"""安全隧道链接 ID"""
2522

@@ -32,6 +29,9 @@ class AccessConfigAccessConfigConnectionResponse(BaseModel):
3229
extra_config: Optional[Dict[str, object]] = None
3330
"""额外配置"""
3431

32+
host: Optional[str] = None
33+
"""数据库地址"""
34+
3535
port: Optional[int] = None
3636
"""数据库端口"""
3737

@@ -114,7 +114,7 @@ class DatasourceRetrieveResponse(BaseModel):
114114
"yashandb",
115115
"gbase8a",
116116
"gaussdbdws",
117-
"bitable",
117+
"bigquery",
118118
"dap",
119119
"duckdb",
120120
"workbook",
@@ -130,7 +130,7 @@ class DatasourceRetrieveResponse(BaseModel):
130130
project_id: str
131131
"""项目 ID"""
132132

133-
sync_status: Literal["processing", "success", "failed", "warning"]
133+
sync_status: Literal["queued", "processing", "success", "failed", "warning"]
134134
"""同步状态"""
135135

136136
access_config: Optional[AccessConfig] = None

‎src/asktable/types/datasource_update_params.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class DatasourceUpdateParams(TypedDict, total=False):
5656
"yashandb",
5757
"gbase8a",
5858
"gaussdbdws",
59-
"bitable",
59+
"bigquery",
6060
"dap",
6161
"duckdb",
6262
"workbook",
@@ -82,14 +82,17 @@ class DatasourceUpdateParams(TypedDict, total=False):
8282
sync_error: Optional[Dict[str, object]]
8383
"""同步错误信息"""
8484

85-
sync_status: Optional[Literal["processing", "success", "failed", "warning"]]
85+
sync_status: Optional[Literal["queued", "processing", "success", "failed", "warning"]]
8686
"""同步状态"""
8787

8888
table_count: Optional[int]
8989
"""表数量"""
9090

9191

9292
class AccessConfigAccessConfigConnectionUpdate(TypedDict, total=False):
93+
credentials: Optional[str]
94+
"""数据库凭证 JSON"""
95+
9396
db: Optional[str]
9497
"""数据库名称"""
9598

‎tests/api_resources/test_datasources.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
3434
datasource = client.datasources.create(
3535
engine="mysql",
3636
access_config={
37-
"host": "192.168.0.10",
37+
"credentials": "credentials",
3838
"db": "at_test",
3939
"db_version": "5.7",
4040
"extra_config": {"ssl_mode": "bar"},
41+
"host": "192.168.0.10",
4142
"password": "root",
4243
"port": 3306,
4344
"securetunnel_id": "atst_123456",
@@ -121,6 +122,7 @@ def test_method_update_with_all_params(self, client: Asktable) -> None:
121122
datasource = client.datasources.update(
122123
datasource_id="datasource_id",
123124
access_config={
125+
"credentials": "credentials",
124126
"db": "at_test",
125127
"db_version": "5.7",
126128
"extra_config": {"ssl_mode": "bar"},
@@ -454,10 +456,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
454456
datasource = await async_client.datasources.create(
455457
engine="mysql",
456458
access_config={
457-
"host": "192.168.0.10",
459+
"credentials": "credentials",
458460
"db": "at_test",
459461
"db_version": "5.7",
460462
"extra_config": {"ssl_mode": "bar"},
463+
"host": "192.168.0.10",
461464
"password": "root",
462465
"port": 3306,
463466
"securetunnel_id": "atst_123456",
@@ -541,6 +544,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable)
541544
datasource = await async_client.datasources.update(
542545
datasource_id="datasource_id",
543546
access_config={
547+
"credentials": "credentials",
544548
"db": "at_test",
545549
"db_version": "5.7",
546550
"extra_config": {"ssl_mode": "bar"},

0 commit comments

Comments
 (0)