Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 91
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-69140680dde56332aa42ebbfbe12c0c3db2adf3904e4a821cee6465e491f4c57.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-7619ea08bed7b776b03ff5e8d23e656968e76e7cf0093888bac1c94deb7153a3.yml
44 changes: 4 additions & 40 deletions src/asktable/resources/datasources/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def create(
self,
datasource_id: str,
*,
name: str,
async_process_meta: bool | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
schemas: Dict[str, meta_create_params.Schemas] | NotGiven = NOT_GIVEN,
Expand All @@ -69,8 +68,6 @@ def create(
否则从数据源中自动获取。

Args:
name: metadata_name

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -83,13 +80,7 @@ def create(
raise ValueError(f"Expected a non-empty value for `datasource_id` but received {datasource_id!r}")
return self._post(
f"/datasources/{datasource_id}/meta",
body=maybe_transform(
{
"name": name,
"schemas": schemas,
},
meta_create_params.MetaCreateParams,
),
body=maybe_transform({"schemas": schemas}, meta_create_params.MetaCreateParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down Expand Up @@ -143,7 +134,6 @@ def update(
self,
datasource_id: str,
*,
name: str,
schemas: Dict[str, meta_update_params.Schemas] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -156,8 +146,6 @@ def update(
用于更新 DB 类型的数据源的 Meta(增加新表或者删除老表)

Args:
name: metadata_name

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -170,13 +158,7 @@ def update(
raise ValueError(f"Expected a non-empty value for `datasource_id` but received {datasource_id!r}")
return self._put(
f"/datasources/{datasource_id}/meta",
body=maybe_transform(
{
"name": name,
"schemas": schemas,
},
meta_update_params.MetaUpdateParams,
),
body=maybe_transform({"schemas": schemas}, meta_update_params.MetaUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -243,7 +225,6 @@ async def create(
self,
datasource_id: str,
*,
name: str,
async_process_meta: bool | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
schemas: Dict[str, meta_create_params.Schemas] | NotGiven = NOT_GIVEN,
Expand All @@ -262,8 +243,6 @@ async def create(
否则从数据源中自动获取。

Args:
name: metadata_name

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -276,13 +255,7 @@ async def create(
raise ValueError(f"Expected a non-empty value for `datasource_id` but received {datasource_id!r}")
return await self._post(
f"/datasources/{datasource_id}/meta",
body=await async_maybe_transform(
{
"name": name,
"schemas": schemas,
},
meta_create_params.MetaCreateParams,
),
body=await async_maybe_transform({"schemas": schemas}, meta_create_params.MetaCreateParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down Expand Up @@ -336,7 +309,6 @@ async def update(
self,
datasource_id: str,
*,
name: str,
schemas: Dict[str, meta_update_params.Schemas] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -349,8 +321,6 @@ async def update(
用于更新 DB 类型的数据源的 Meta(增加新表或者删除老表)

Args:
name: metadata_name

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -363,13 +333,7 @@ async def update(
raise ValueError(f"Expected a non-empty value for `datasource_id` but received {datasource_id!r}")
return await self._put(
f"/datasources/{datasource_id}/meta",
body=await async_maybe_transform(
{
"name": name,
"schemas": schemas,
},
meta_update_params.MetaUpdateParams,
),
body=await async_maybe_transform({"schemas": schemas}, meta_update_params.MetaUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down
3 changes: 0 additions & 3 deletions src/asktable/types/datasources/meta_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@


class MetaCreateParams(TypedDict, total=False):
name: Required[str]
"""metadata_name"""

async_process_meta: bool

value_index: bool
Expand Down
3 changes: 0 additions & 3 deletions src/asktable/types/datasources/meta_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@


class MetaUpdateParams(TypedDict, total=False):
name: Required[str]
"""metadata_name"""

schemas: Dict[str, Schemas]


Expand Down
3 changes: 0 additions & 3 deletions src/asktable/types/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,4 @@ class Meta(BaseModel):
datasource_id: str
"""datasource_id"""

name: str
"""metadata_name"""

schemas: Optional[Dict[str, Schemas]] = None
20 changes: 0 additions & 20 deletions tests/api_resources/datasources/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ class TestMeta:
def test_method_create(self, client: Asktable) -> None:
meta = client.datasources.meta.create(
datasource_id="datasource_id",
name="name",
)
assert_matches_type(object, meta, path=["response"])

@parametrize
def test_method_create_with_all_params(self, client: Asktable) -> None:
meta = client.datasources.meta.create(
datasource_id="datasource_id",
name="name",
async_process_meta=True,
value_index=True,
schemas={
Expand Down Expand Up @@ -60,7 +58,6 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
def test_raw_response_create(self, client: Asktable) -> None:
response = client.datasources.meta.with_raw_response.create(
datasource_id="datasource_id",
name="name",
)

assert response.is_closed is True
Expand All @@ -72,7 +69,6 @@ def test_raw_response_create(self, client: Asktable) -> None:
def test_streaming_response_create(self, client: Asktable) -> None:
with client.datasources.meta.with_streaming_response.create(
datasource_id="datasource_id",
name="name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -87,7 +83,6 @@ def test_path_params_create(self, client: Asktable) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `datasource_id` but received ''"):
client.datasources.meta.with_raw_response.create(
datasource_id="",
name="name",
)

@parametrize
Expand Down Expand Up @@ -132,15 +127,13 @@ def test_path_params_retrieve(self, client: Asktable) -> None:
def test_method_update(self, client: Asktable) -> None:
meta = client.datasources.meta.update(
datasource_id="datasource_id",
name="name",
)
assert_matches_type(object, meta, path=["response"])

@parametrize
def test_method_update_with_all_params(self, client: Asktable) -> None:
meta = client.datasources.meta.update(
datasource_id="datasource_id",
name="name",
schemas={
"foo": {
"name": "name",
Expand Down Expand Up @@ -169,7 +162,6 @@ def test_method_update_with_all_params(self, client: Asktable) -> None:
def test_raw_response_update(self, client: Asktable) -> None:
response = client.datasources.meta.with_raw_response.update(
datasource_id="datasource_id",
name="name",
)

assert response.is_closed is True
Expand All @@ -181,7 +173,6 @@ def test_raw_response_update(self, client: Asktable) -> None:
def test_streaming_response_update(self, client: Asktable) -> None:
with client.datasources.meta.with_streaming_response.update(
datasource_id="datasource_id",
name="name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -196,7 +187,6 @@ def test_path_params_update(self, client: Asktable) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `datasource_id` but received ''"):
client.datasources.meta.with_raw_response.update(
datasource_id="",
name="name",
)

@parametrize
Expand Down Expand Up @@ -249,15 +239,13 @@ class TestAsyncMeta:
async def test_method_create(self, async_client: AsyncAsktable) -> None:
meta = await async_client.datasources.meta.create(
datasource_id="datasource_id",
name="name",
)
assert_matches_type(object, meta, path=["response"])

@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncAsktable) -> None:
meta = await async_client.datasources.meta.create(
datasource_id="datasource_id",
name="name",
async_process_meta=True,
value_index=True,
schemas={
Expand Down Expand Up @@ -288,7 +276,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
async def test_raw_response_create(self, async_client: AsyncAsktable) -> None:
response = await async_client.datasources.meta.with_raw_response.create(
datasource_id="datasource_id",
name="name",
)

assert response.is_closed is True
Expand All @@ -300,7 +287,6 @@ async def test_raw_response_create(self, async_client: AsyncAsktable) -> None:
async def test_streaming_response_create(self, async_client: AsyncAsktable) -> None:
async with async_client.datasources.meta.with_streaming_response.create(
datasource_id="datasource_id",
name="name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -315,7 +301,6 @@ async def test_path_params_create(self, async_client: AsyncAsktable) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `datasource_id` but received ''"):
await async_client.datasources.meta.with_raw_response.create(
datasource_id="",
name="name",
)

@parametrize
Expand Down Expand Up @@ -360,15 +345,13 @@ async def test_path_params_retrieve(self, async_client: AsyncAsktable) -> None:
async def test_method_update(self, async_client: AsyncAsktable) -> None:
meta = await async_client.datasources.meta.update(
datasource_id="datasource_id",
name="name",
)
assert_matches_type(object, meta, path=["response"])

@parametrize
async def test_method_update_with_all_params(self, async_client: AsyncAsktable) -> None:
meta = await async_client.datasources.meta.update(
datasource_id="datasource_id",
name="name",
schemas={
"foo": {
"name": "name",
Expand Down Expand Up @@ -397,7 +380,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable)
async def test_raw_response_update(self, async_client: AsyncAsktable) -> None:
response = await async_client.datasources.meta.with_raw_response.update(
datasource_id="datasource_id",
name="name",
)

assert response.is_closed is True
Expand All @@ -409,7 +391,6 @@ async def test_raw_response_update(self, async_client: AsyncAsktable) -> None:
async def test_streaming_response_update(self, async_client: AsyncAsktable) -> None:
async with async_client.datasources.meta.with_streaming_response.update(
datasource_id="datasource_id",
name="name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -424,7 +405,6 @@ async def test_path_params_update(self, async_client: AsyncAsktable) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `datasource_id` but received ''"):
await async_client.datasources.meta.with_raw_response.update(
datasource_id="",
name="name",
)

@parametrize
Expand Down