Skip to content

Commit 51f6199

Browse files
authored
chore(llmobs): description should be optional when create_dataset (#14275)
description should be optional when create_dataset ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
1 parent 1bd9fe9 commit 51f6199

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

ddtrace/llmobs/_llmobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ def pull_dataset(cls, name: str) -> Dataset:
631631
return ds
632632

633633
@classmethod
634-
def create_dataset(cls, name: str, description: str, records: Optional[List[DatasetRecord]] = None) -> Dataset:
634+
def create_dataset(cls, name: str, description: str = "", records: Optional[List[DatasetRecord]] = None) -> Dataset:
635635
if records is None:
636636
records = []
637637
ds = cls._instance._dne_client.dataset_create(name, description)

ddtrace/llmobs/_writer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,14 +357,13 @@ def dataset_create(self, name: str, description: str) -> Dataset:
357357

358358
@staticmethod
359359
def _get_record_json(record: Union[UpdatableDatasetRecord, DatasetRecordRaw], is_update: bool) -> JSONType:
360-
# for now, if a user wants to "erase" the value of expected_output, they are expected to
361-
# set expected_output to None, and we serialize that as empty string to indicate this to BE
360+
# for now, if a user wants to "erase" the value of expected_output or metadata, they are expected to
361+
# set it to None, and we serialize an empty string (for expected_output) and empty dict (for metadata)
362+
# to indicate this erasure to BE
362363
expected_output: JSONType = None
363364
if "expected_output" in record:
364365
expected_output = "" if record["expected_output"] is None else record["expected_output"]
365366

366-
# for now, if a user wants to "erase" the value of metadata, they are expected to
367-
# set metadata to None, and we serialize that as an empty map to indicate this to BE
368367
metadata: JSONType = None
369368
if "metadata" in record:
370369
metadata = {} if record["metadata"] is None else record["metadata"]

0 commit comments

Comments
 (0)