Skip to content

Commit d6a79d0

Browse files
fix: remove duplicate dataset_id parameter in append-rows endpoint
1 parent 021bd5e commit d6a79d0

5 files changed

Lines changed: 26 additions & 57 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: 102
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-60d07d12e08e84edf3d1d8665182f45548d840821600ee994b7e4f32c40c1d49.yml
3-
openapi_spec_hash: 375be93b0b1348b7dac1a4749f806870
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-36a0290facb461859b027e5f50206ce9c05fc5d0e8366d1e210ade0bda556936.yml
3+
openapi_spec_hash: 7ca2a28f0cc0958f01709c749cc3b7a4
44
config_hash: d1db834ac019b3bb2e260c9e37dcb5d1

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ Methods:
522522

523523
- <code title="get /v1beta/datasets/{dataset_id}">client.beta.datasets.<a href="./src/llama_stack_client/resources/beta/datasets.py">retrieve</a>(dataset_id) -> <a href="./src/llama_stack_client/types/beta/dataset_retrieve_response.py">DatasetRetrieveResponse</a></code>
524524
- <code title="get /v1beta/datasets">client.beta.datasets.<a href="./src/llama_stack_client/resources/beta/datasets.py">list</a>() -> <a href="./src/llama_stack_client/types/beta/dataset_list_response.py">DatasetListResponse</a></code>
525-
- <code title="post /v1beta/datasetio/append-rows/{dataset_id}">client.beta.datasets.<a href="./src/llama_stack_client/resources/beta/datasets.py">appendrows</a>(path_dataset_id, \*\*<a href="src/llama_stack_client/types/beta/dataset_appendrows_params.py">params</a>) -> None</code>
525+
- <code title="post /v1beta/datasetio/append-rows/{dataset_id}">client.beta.datasets.<a href="./src/llama_stack_client/resources/beta/datasets.py">appendrows</a>(dataset_id, \*\*<a href="src/llama_stack_client/types/beta/dataset_appendrows_params.py">params</a>) -> None</code>
526526
- <code title="get /v1beta/datasetio/iterrows/{dataset_id}">client.beta.datasets.<a href="./src/llama_stack_client/resources/beta/datasets.py">iterrows</a>(dataset_id, \*\*<a href="src/llama_stack_client/types/beta/dataset_iterrows_params.py">params</a>) -> <a href="./src/llama_stack_client/types/beta/dataset_iterrows_response.py">DatasetIterrowsResponse</a></code>
527527
- <code title="post /v1beta/datasets">client.beta.datasets.<a href="./src/llama_stack_client/resources/beta/datasets.py">register</a>(\*\*<a href="src/llama_stack_client/types/beta/dataset_register_params.py">params</a>) -> <a href="./src/llama_stack_client/types/beta/dataset_register_response.py">DatasetRegisterResponse</a></code>
528528
- <code title="delete /v1beta/datasets/{dataset_id}">client.beta.datasets.<a href="./src/llama_stack_client/resources/beta/datasets.py">unregister</a>(dataset_id) -> None</code>

src/llama_stack_client/resources/beta/datasets.py

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,8 @@ def list(
115115

116116
def appendrows(
117117
self,
118-
path_dataset_id: str,
118+
dataset_id: str,
119119
*,
120-
body_dataset_id: str,
121120
rows: Iterable[Dict[str, object]],
122121
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
123122
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -130,9 +129,7 @@ def appendrows(
130129
Append rows to a dataset.
131130
132131
Args:
133-
path_dataset_id: The ID of the dataset to append the rows to.
134-
135-
body_dataset_id: The ID of the dataset to append the rows to.
132+
dataset_id: The ID of the dataset to append the rows to.
136133
137134
rows: The rows to append to the dataset.
138135
@@ -144,18 +141,12 @@ def appendrows(
144141
145142
timeout: Override the client-level default timeout for this request, in seconds
146143
"""
147-
if not path_dataset_id:
148-
raise ValueError(f"Expected a non-empty value for `path_dataset_id` but received {path_dataset_id!r}")
144+
if not dataset_id:
145+
raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}")
149146
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
150147
return self._post(
151-
f"/v1beta/datasetio/append-rows/{path_dataset_id}",
152-
body=maybe_transform(
153-
{
154-
"body_dataset_id": body_dataset_id,
155-
"rows": rows,
156-
},
157-
dataset_appendrows_params.DatasetAppendrowsParams,
158-
),
148+
f"/v1beta/datasetio/append-rows/{dataset_id}",
149+
body=maybe_transform({"rows": rows}, dataset_appendrows_params.DatasetAppendrowsParams),
159150
options=make_request_options(
160151
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
161152
),
@@ -393,9 +384,8 @@ async def list(
393384

394385
async def appendrows(
395386
self,
396-
path_dataset_id: str,
387+
dataset_id: str,
397388
*,
398-
body_dataset_id: str,
399389
rows: Iterable[Dict[str, object]],
400390
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
401391
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -408,9 +398,7 @@ async def appendrows(
408398
Append rows to a dataset.
409399
410400
Args:
411-
path_dataset_id: The ID of the dataset to append the rows to.
412-
413-
body_dataset_id: The ID of the dataset to append the rows to.
401+
dataset_id: The ID of the dataset to append the rows to.
414402
415403
rows: The rows to append to the dataset.
416404
@@ -422,18 +410,12 @@ async def appendrows(
422410
423411
timeout: Override the client-level default timeout for this request, in seconds
424412
"""
425-
if not path_dataset_id:
426-
raise ValueError(f"Expected a non-empty value for `path_dataset_id` but received {path_dataset_id!r}")
413+
if not dataset_id:
414+
raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}")
427415
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
428416
return await self._post(
429-
f"/v1beta/datasetio/append-rows/{path_dataset_id}",
430-
body=await async_maybe_transform(
431-
{
432-
"body_dataset_id": body_dataset_id,
433-
"rows": rows,
434-
},
435-
dataset_appendrows_params.DatasetAppendrowsParams,
436-
),
417+
f"/v1beta/datasetio/append-rows/{dataset_id}",
418+
body=await async_maybe_transform({"rows": rows}, dataset_appendrows_params.DatasetAppendrowsParams),
437419
options=make_request_options(
438420
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
439421
),

src/llama_stack_client/types/beta/dataset_appendrows_params.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@
99
from __future__ import annotations
1010

1111
from typing import Dict, Iterable
12-
from typing_extensions import Required, Annotated, TypedDict
13-
14-
from ..._utils import PropertyInfo
12+
from typing_extensions import Required, TypedDict
1513

1614
__all__ = ["DatasetAppendrowsParams"]
1715

1816

1917
class DatasetAppendrowsParams(TypedDict, total=False):
20-
body_dataset_id: Required[Annotated[str, PropertyInfo(alias="dataset_id")]]
21-
"""The ID of the dataset to append the rows to."""
22-
2318
rows: Required[Iterable[Dict[str, object]]]
2419
"""The rows to append to the dataset."""

tests/api_resources/beta/test_datasets.py

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,15 @@ def test_streaming_response_list(self, client: LlamaStackClient) -> None:
9696
@parametrize
9797
def test_method_appendrows(self, client: LlamaStackClient) -> None:
9898
dataset = client.beta.datasets.appendrows(
99-
path_dataset_id="dataset_id",
100-
body_dataset_id="dataset_id",
99+
dataset_id="dataset_id",
101100
rows=[{"foo": "bar"}],
102101
)
103102
assert dataset is None
104103

105104
@parametrize
106105
def test_raw_response_appendrows(self, client: LlamaStackClient) -> None:
107106
response = client.beta.datasets.with_raw_response.appendrows(
108-
path_dataset_id="dataset_id",
109-
body_dataset_id="dataset_id",
107+
dataset_id="dataset_id",
110108
rows=[{"foo": "bar"}],
111109
)
112110

@@ -118,8 +116,7 @@ def test_raw_response_appendrows(self, client: LlamaStackClient) -> None:
118116
@parametrize
119117
def test_streaming_response_appendrows(self, client: LlamaStackClient) -> None:
120118
with client.beta.datasets.with_streaming_response.appendrows(
121-
path_dataset_id="dataset_id",
122-
body_dataset_id="dataset_id",
119+
dataset_id="dataset_id",
123120
rows=[{"foo": "bar"}],
124121
) as response:
125122
assert not response.is_closed
@@ -132,10 +129,9 @@ def test_streaming_response_appendrows(self, client: LlamaStackClient) -> None:
132129

133130
@parametrize
134131
def test_path_params_appendrows(self, client: LlamaStackClient) -> None:
135-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_dataset_id` but received ''"):
132+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
136133
client.beta.datasets.with_raw_response.appendrows(
137-
path_dataset_id="",
138-
body_dataset_id="dataset_id",
134+
dataset_id="",
139135
rows=[{"foo": "bar"}],
140136
)
141137

@@ -363,17 +359,15 @@ async def test_streaming_response_list(self, async_client: AsyncLlamaStackClient
363359
@parametrize
364360
async def test_method_appendrows(self, async_client: AsyncLlamaStackClient) -> None:
365361
dataset = await async_client.beta.datasets.appendrows(
366-
path_dataset_id="dataset_id",
367-
body_dataset_id="dataset_id",
362+
dataset_id="dataset_id",
368363
rows=[{"foo": "bar"}],
369364
)
370365
assert dataset is None
371366

372367
@parametrize
373368
async def test_raw_response_appendrows(self, async_client: AsyncLlamaStackClient) -> None:
374369
response = await async_client.beta.datasets.with_raw_response.appendrows(
375-
path_dataset_id="dataset_id",
376-
body_dataset_id="dataset_id",
370+
dataset_id="dataset_id",
377371
rows=[{"foo": "bar"}],
378372
)
379373

@@ -385,8 +379,7 @@ async def test_raw_response_appendrows(self, async_client: AsyncLlamaStackClient
385379
@parametrize
386380
async def test_streaming_response_appendrows(self, async_client: AsyncLlamaStackClient) -> None:
387381
async with async_client.beta.datasets.with_streaming_response.appendrows(
388-
path_dataset_id="dataset_id",
389-
body_dataset_id="dataset_id",
382+
dataset_id="dataset_id",
390383
rows=[{"foo": "bar"}],
391384
) as response:
392385
assert not response.is_closed
@@ -399,10 +392,9 @@ async def test_streaming_response_appendrows(self, async_client: AsyncLlamaStack
399392

400393
@parametrize
401394
async def test_path_params_appendrows(self, async_client: AsyncLlamaStackClient) -> None:
402-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_dataset_id` but received ''"):
395+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"):
403396
await async_client.beta.datasets.with_raw_response.appendrows(
404-
path_dataset_id="",
405-
body_dataset_id="dataset_id",
397+
dataset_id="",
406398
rows=[{"foo": "bar"}],
407399
)
408400

0 commit comments

Comments
 (0)