Skip to content

Commit 625960a

Browse files
fix tests
Co-authored-by: Yahya Mouman <[email protected]>
1 parent 51fb500 commit 625960a

File tree

44 files changed

+620
-240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+620
-240
lines changed

ddtrace/llmobs/_experiment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ def push(self) -> None:
142142

143143
def update(self, index: int, record: DatasetRecordRaw) -> None:
144144
if "input_data" not in record and "expected_output" not in record and "metadata" not in record:
145-
raise ValueError("invalid update, at least one of input_data, expected_output, or metadata must be updated")
145+
raise ValueError(
146+
"invalid update, record should contain at least one of input_data, expected_output, or metadata to update"
147+
)
146148
record_id = self._records[index]["record_id"]
147149
self._updated_record_ids.append(record_id)
148150
self._records[index] = {**record, "record_id": record_id}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
interactions:
22
- request:
3-
body: '{"data": {"type": "datasets", "id": "c1129a9c-35c8-41fb-acbb-b01b72e672b3",
3+
body: '{"data": {"type": "datasets", "id": "02299014-fa9b-409d-af64-266f9b077c5d",
44
"attributes": {"insert_records": [{"input": {"prompt": "What is the capital
5-
of France?"}, "expected_output": {"answer": "Paris"}, "metadata": {}}], "update_records":
5+
of France?"}, "expected_output": {"answer": "Paris"}, "metadata": null}], "update_records":
66
[], "delete_records": []}}}'
77
headers:
88
Accept:
@@ -13,27 +13,27 @@ interactions:
1313
Connection:
1414
- keep-alive
1515
Content-Length:
16-
- '269'
16+
- '271'
1717
? !!python/object/apply:multidict._multidict.istr
1818
- Content-Type
1919
: - application/json
2020
User-Agent:
2121
- python-requests/2.32.3
2222
method: POST
23-
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/c1129a9c-35c8-41fb-acbb-b01b72e672b3/batch_update
23+
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/02299014-fa9b-409d-af64-266f9b077c5d/batch_update
2424
response:
2525
body:
26-
string: '{"data":[{"id":"106302a9-678e-4465-9a54-9c158cdd55b0","type":"datasets","attributes":{"author":{"id":"de473b30-eb9f-11e9-a77a-c7405862b8bd"},"created_at":"2025-08-06T03:00:20.452940856Z","dataset_id":"c1129a9c-35c8-41fb-acbb-b01b72e672b3","expected_output":{"answer":"Paris"},"input":{"prompt":"What
27-
is the capital of France?"},"metadata":{},"updated_at":"2025-08-06T03:00:20.452940856Z","version":1}}]}'
26+
string: '{"data":[{"id":"2468b370-ff5f-40fd-ace3-497468c32f52","type":"datasets","attributes":{"author":{"id":"a7cd01e3-f412-11ed-a144-0aa89e224034"},"created_at":"2025-08-06T16:20:22.123409391Z","dataset_id":"02299014-fa9b-409d-af64-266f9b077c5d","expected_output":{"answer":"Paris"},"input":{"prompt":"What
27+
is the capital of France?"},"updated_at":"2025-08-06T16:20:22.123409391Z","version":1}}]}'
2828
headers:
2929
content-length:
30-
- '403'
30+
- '389'
3131
content-security-policy:
3232
- frame-ancestors 'self'; report-uri https://logs.browser-intake-datadoghq.com/api/v2/logs?dd-api-key=pube4f163c23bbf91c16b8f57f56af9fc58&dd-evp-origin=content-security-policy&ddsource=csp-report&ddtags=site%3Adatadoghq.com
3333
content-type:
3434
- application/vnd.api+json
3535
date:
36-
- Wed, 06 Aug 2025 03:00:20 GMT
36+
- Wed, 06 Aug 2025 16:20:22 GMT
3737
strict-transport-security:
3838
- max-age=31536000; includeSubDomains; preload
3939
vary:
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
interactions:
22
- request:
3-
body: '{"data": {"type": "datasets", "id": "c1129a9c-35c8-41fb-acbb-b01b72e672b3",
3+
body: '{"data": {"type": "datasets", "id": "02299014-fa9b-409d-af64-266f9b077c5d",
44
"attributes": {"insert_records": [], "update_records": [{"input": null, "expected_output":
5-
"", "metadata": {}, "id": "106302a9-678e-4465-9a54-9c158cdd55b0"}], "delete_records":
5+
"", "metadata": null, "id": "2468b370-ff5f-40fd-ace3-497468c32f52"}], "delete_records":
66
[]}}}'
77
headers:
88
Accept:
@@ -13,27 +13,27 @@ interactions:
1313
Connection:
1414
- keep-alive
1515
Content-Length:
16-
- '258'
16+
- '260'
1717
? !!python/object/apply:multidict._multidict.istr
1818
- Content-Type
1919
: - application/json
2020
User-Agent:
2121
- python-requests/2.32.3
2222
method: POST
23-
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/c1129a9c-35c8-41fb-acbb-b01b72e672b3/batch_update
23+
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/02299014-fa9b-409d-af64-266f9b077c5d/batch_update
2424
response:
2525
body:
26-
string: '{"data":[{"id":"784ff4b0-dc28-4766-8e20-33d3b9c122de","type":"datasets","attributes":{"author":{"id":"de473b30-eb9f-11e9-a77a-c7405862b8bd"},"created_at":"2025-08-06T03:00:23.232545193Z","dataset_id":"c1129a9c-35c8-41fb-acbb-b01b72e672b3","expected_output":"","input":{"prompt":"What
27-
is the capital of France?"},"metadata":{},"updated_at":"2025-08-06T03:00:23.232545266Z","version":2}}]}'
26+
string: '{"data":[{"id":"85c4c2fa-d901-4d11-a7a7-b868bb77deaa","type":"datasets","attributes":{"author":{"id":"a7cd01e3-f412-11ed-a144-0aa89e224034"},"created_at":"2025-08-06T16:20:24.804599279Z","dataset_id":"02299014-fa9b-409d-af64-266f9b077c5d","expected_output":"","input":{"prompt":"What
27+
is the capital of France?"},"updated_at":"2025-08-06T16:20:24.804599378Z","version":2}}]}'
2828
headers:
2929
content-length:
30-
- '387'
30+
- '373'
3131
content-security-policy:
3232
- frame-ancestors 'self'; report-uri https://logs.browser-intake-datadoghq.com/api/v2/logs?dd-api-key=pube4f163c23bbf91c16b8f57f56af9fc58&dd-evp-origin=content-security-policy&ddsource=csp-report&ddtags=site%3Adatadoghq.com
3333
content-type:
3434
- application/vnd.api+json
3535
date:
36-
- Wed, 06 Aug 2025 03:00:23 GMT
36+
- Wed, 06 Aug 2025 16:20:24 GMT
3737
strict-transport-security:
3838
- max-age=31536000; includeSubDomains; preload
3939
vary:
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ interactions:
1818
User-Agent:
1919
- python-requests/2.32.3
2020
method: GET
21-
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/2f376001-f964-4f1e-897d-4585ccff39ea/records
21+
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/02299014-fa9b-409d-af64-266f9b077c5d/records
2222
response:
2323
body:
24-
string: '{"data":[{"id":"8d55ad5a-528e-46c4-bd58-76e3d2ea4ddf","type":"datasets","attributes":{"author":{"id":"de473b30-eb9f-11e9-a77a-c7405862b8bd"},"created_at":"2025-08-06T03:00:50.046982Z","dataset_id":"2f376001-f964-4f1e-897d-4585ccff39ea","expected_output":"","input":{"prompt":"What
25-
is the capital of Nauru?"},"metadata":{},"updated_at":"2025-08-06T03:00:50.046982Z"}}],"meta":{"after":""}}'
24+
string: '{"data":[{"id":"85c4c2fa-d901-4d11-a7a7-b868bb77deaa","type":"datasets","attributes":{"author":{"id":"a7cd01e3-f412-11ed-a144-0aa89e224034"},"created_at":"2025-08-06T16:20:24.804599Z","dataset_id":"02299014-fa9b-409d-af64-266f9b077c5d","expected_output":"","input":{"prompt":"What
25+
is the capital of France?"},"updated_at":"2025-08-06T16:20:24.804599Z"}}],"meta":{"after":""}}'
2626
headers:
2727
content-length:
28-
- '388'
28+
- '375'
2929
content-security-policy:
3030
- frame-ancestors 'self'; report-uri https://logs.browser-intake-datadoghq.com/api/v2/logs?dd-api-key=pube4f163c23bbf91c16b8f57f56af9fc58&dd-evp-origin=content-security-policy&ddsource=csp-report&ddtags=site%3Adatadoghq.com
3131
content-type:
3232
- application/vnd.api+json
3333
date:
34-
- Wed, 06 Aug 2025 03:00:57 GMT
34+
- Wed, 06 Aug 2025 16:20:27 GMT
3535
strict-transport-security:
3636
- max-age=31536000; includeSubDomains; preload
3737
vary:

tests/llmobs/llmobs_cassettes/datadog/datadog_api_unstable_llm-obs_v1_datasets_05c49e7d-1f10-4f4f-a660-114b00674e13_records_get_c5eb7aac.yaml

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
interactions:
22
- request:
3-
body: '{"data": {"type": "datasets", "id": "05c49e7d-1f10-4f4f-a660-114b00674e13",
3+
body: '{"data": {"type": "datasets", "id": "15903f83-b554-4a54-8448-0741b1c0f2aa",
44
"attributes": {"insert_records": [{"input": {"prompt": "What is the capital
5-
of France?"}, "expected_output": {"answer": "Paris"}, "metadata": {}}], "update_records":
5+
of France?"}, "expected_output": {"answer": "Paris"}, "metadata": null}], "update_records":
66
[], "delete_records": []}}}'
77
headers:
88
Accept:
@@ -13,27 +13,27 @@ interactions:
1313
Connection:
1414
- keep-alive
1515
Content-Length:
16-
- '269'
16+
- '271'
1717
? !!python/object/apply:multidict._multidict.istr
1818
- Content-Type
1919
: - application/json
2020
User-Agent:
2121
- python-requests/2.32.3
2222
method: POST
23-
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/05c49e7d-1f10-4f4f-a660-114b00674e13/batch_update
23+
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/15903f83-b554-4a54-8448-0741b1c0f2aa/batch_update
2424
response:
2525
body:
26-
string: '{"data":[{"id":"3f4b5c92-27d5-40f7-a655-a9557af891ce","type":"datasets","attributes":{"author":{"id":"de473b30-eb9f-11e9-a77a-c7405862b8bd"},"created_at":"2025-08-06T03:00:34.501998598Z","dataset_id":"05c49e7d-1f10-4f4f-a660-114b00674e13","expected_output":{"answer":"Paris"},"input":{"prompt":"What
27-
is the capital of France?"},"metadata":{},"updated_at":"2025-08-06T03:00:34.501998598Z","version":1}}]}'
26+
string: '{"data":[{"id":"23bc4211-8eb9-4579-81ef-2605554d78fe","type":"datasets","attributes":{"author":{"id":"a7cd01e3-f412-11ed-a144-0aa89e224034"},"created_at":"2025-08-06T16:20:59.771284671Z","dataset_id":"15903f83-b554-4a54-8448-0741b1c0f2aa","expected_output":{"answer":"Paris"},"input":{"prompt":"What
27+
is the capital of France?"},"updated_at":"2025-08-06T16:20:59.771284671Z","version":1}}]}'
2828
headers:
2929
content-length:
30-
- '403'
30+
- '389'
3131
content-security-policy:
3232
- frame-ancestors 'self'; report-uri https://logs.browser-intake-datadoghq.com/api/v2/logs?dd-api-key=pube4f163c23bbf91c16b8f57f56af9fc58&dd-evp-origin=content-security-policy&ddsource=csp-report&ddtags=site%3Adatadoghq.com
3333
content-type:
3434
- application/vnd.api+json
3535
date:
36-
- Wed, 06 Aug 2025 03:00:34 GMT
36+
- Wed, 06 Aug 2025 16:21:00 GMT
3737
strict-transport-security:
3838
- max-age=31536000; includeSubDomains; preload
3939
vary:
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
interactions:
22
- request:
3-
body: '{"data": {"type": "datasets", "id": "05c49e7d-1f10-4f4f-a660-114b00674e13",
3+
body: '{"data": {"type": "datasets", "id": "15903f83-b554-4a54-8448-0741b1c0f2aa",
44
"attributes": {"insert_records": [{"input": {"prompt": "What is the capital
5-
of Sealand?"}, "expected_output": "", "metadata": {}}], "update_records": [],
6-
"delete_records": []}}}'
5+
of Sealand?"}, "expected_output": null, "metadata": null}], "update_records":
6+
[], "delete_records": []}}}'
77
headers:
88
Accept:
99
- '*/*'
@@ -13,27 +13,27 @@ interactions:
1313
Connection:
1414
- keep-alive
1515
Content-Length:
16-
- '253'
16+
- '257'
1717
? !!python/object/apply:multidict._multidict.istr
1818
- Content-Type
1919
: - application/json
2020
User-Agent:
2121
- python-requests/2.32.3
2222
method: POST
23-
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/05c49e7d-1f10-4f4f-a660-114b00674e13/batch_update
23+
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/15903f83-b554-4a54-8448-0741b1c0f2aa/batch_update
2424
response:
2525
body:
26-
string: '{"data":[{"id":"ff37d6e6-98cf-45c6-b042-cc603f065858","type":"datasets","attributes":{"author":{"id":"de473b30-eb9f-11e9-a77a-c7405862b8bd"},"created_at":"2025-08-06T03:00:38.997580069Z","dataset_id":"05c49e7d-1f10-4f4f-a660-114b00674e13","expected_output":"","input":{"prompt":"What
27-
is the capital of Sealand?"},"metadata":{},"updated_at":"2025-08-06T03:00:38.997580069Z","version":2}}]}'
26+
string: '{"data":[{"id":"19a8e177-430b-4384-81ed-10b419f76eca","type":"datasets","attributes":{"author":{"id":"a7cd01e3-f412-11ed-a144-0aa89e224034"},"created_at":"2025-08-06T16:21:04.184059658Z","dataset_id":"15903f83-b554-4a54-8448-0741b1c0f2aa","input":{"prompt":"What
27+
is the capital of Sealand?"},"updated_at":"2025-08-06T16:21:04.184059658Z","version":2}}]}'
2828
headers:
2929
content-length:
30-
- '388'
30+
- '353'
3131
content-security-policy:
3232
- frame-ancestors 'self'; report-uri https://logs.browser-intake-datadoghq.com/api/v2/logs?dd-api-key=pube4f163c23bbf91c16b8f57f56af9fc58&dd-evp-origin=content-security-policy&ddsource=csp-report&ddtags=site%3Adatadoghq.com
3333
content-type:
3434
- application/vnd.api+json
3535
date:
36-
- Wed, 06 Aug 2025 03:00:39 GMT
36+
- Wed, 06 Aug 2025 16:21:04 GMT
3737
strict-transport-security:
3838
- max-age=31536000; includeSubDomains; preload
3939
vary:
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
Accept:
6+
- '*/*'
7+
? !!python/object/apply:multidict._multidict.istr
8+
- Accept-Encoding
9+
: - identity
10+
Connection:
11+
- keep-alive
12+
? !!python/object/apply:multidict._multidict.istr
13+
- Content-Length
14+
: - '0'
15+
? !!python/object/apply:multidict._multidict.istr
16+
- Content-Type
17+
: - application/json
18+
User-Agent:
19+
- python-requests/2.32.3
20+
method: GET
21+
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/15903f83-b554-4a54-8448-0741b1c0f2aa/records
22+
response:
23+
body:
24+
string: '{"data":[{"id":"19a8e177-430b-4384-81ed-10b419f76eca","type":"datasets","attributes":{"author":{"id":"a7cd01e3-f412-11ed-a144-0aa89e224034"},"created_at":"2025-08-06T16:21:04.184059Z","dataset_id":"15903f83-b554-4a54-8448-0741b1c0f2aa","input":{"prompt":"What
25+
is the capital of Sealand?"},"updated_at":"2025-08-06T16:21:04.184059Z"}},{"id":"23bc4211-8eb9-4579-81ef-2605554d78fe","type":"datasets","attributes":{"author":{"id":"a7cd01e3-f412-11ed-a144-0aa89e224034"},"created_at":"2025-08-06T16:20:59.771284Z","dataset_id":"15903f83-b554-4a54-8448-0741b1c0f2aa","expected_output":{"answer":"Paris"},"input":{"prompt":"What
26+
is the capital of France?"},"updated_at":"2025-08-06T16:20:59.771284Z"}}],"meta":{"after":""}}'
27+
headers:
28+
content-length:
29+
- '716'
30+
content-security-policy:
31+
- frame-ancestors 'self'; report-uri https://logs.browser-intake-datadoghq.com/api/v2/logs?dd-api-key=pube4f163c23bbf91c16b8f57f56af9fc58&dd-evp-origin=content-security-policy&ddsource=csp-report&ddtags=site%3Adatadoghq.com
32+
content-type:
33+
- application/vnd.api+json
34+
date:
35+
- Wed, 06 Aug 2025 16:21:07 GMT
36+
strict-transport-security:
37+
- max-age=31536000; includeSubDomains; preload
38+
vary:
39+
- Accept-Encoding
40+
x-content-type-options:
41+
- nosniff
42+
x-frame-options:
43+
- SAMEORIGIN
44+
status:
45+
code: 200
46+
message: OK
47+
version: 1

tests/llmobs/llmobs_cassettes/datadog/datadog_api_unstable_llm-obs_v1_datasets_2f376001-f964-4f1e-897d-4585ccff39ea_batch_update_post_ad0672fd.yaml

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
interactions:
22
- request:
3-
body: '{"data": {"type": "datasets", "id": "2f376001-f964-4f1e-897d-4585ccff39ea",
3+
body: '{"data": {"type": "datasets", "id": "55c9fa1e-61ec-49c9-98c8-89611f0728b5",
44
"attributes": {"insert_records": [], "update_records": [], "delete_records":
5-
["f859c072-c30a-497b-be53-a66d14fedd57"]}}}'
5+
["3dcb6183-0f7f-43dd-9436-f57908bc5ed9"]}}}'
66
headers:
77
Accept:
88
- '*/*'
@@ -19,7 +19,7 @@ interactions:
1919
User-Agent:
2020
- python-requests/2.32.3
2121
method: POST
22-
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/2f376001-f964-4f1e-897d-4585ccff39ea/batch_update
22+
uri: https://api.datadoghq.com/api/unstable/llm-obs/v1/datasets/55c9fa1e-61ec-49c9-98c8-89611f0728b5/batch_update
2323
response:
2424
body:
2525
string: '{"data":[]}'
@@ -31,7 +31,7 @@ interactions:
3131
content-type:
3232
- application/vnd.api+json
3333
date:
34-
- Wed, 06 Aug 2025 03:00:54 GMT
34+
- Wed, 06 Aug 2025 16:21:17 GMT
3535
strict-transport-security:
3636
- max-age=31536000; includeSubDomains; preload
3737
vary:

0 commit comments

Comments
 (0)