Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ def add_examples_to_dataset(
inputs: Iterable[Mapping[str, Any]] = (),
outputs: Iterable[Mapping[str, Any]] = (),
metadata: Iterable[Mapping[str, Any]] = (),
dataset_version_description: Optional[str] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be passed in as the overall dataset description below. For that reason I don't think this is the right param?

Note, I think given that we already have dataset in the method name, let's change this to 'version_description'

timeout: Optional[int] = DEFAULT_TIMEOUT_IN_SECONDS,
) -> Dataset:
"""
Expand All @@ -781,6 +782,7 @@ def add_examples_to_dataset(
inputs: List of dictionaries each corresponding to an example.
outputs: List of dictionaries each corresponding to an example.
metadata: List of dictionaries each corresponding to an example.
dataset_version_description: Optional description for the new dataset version.
timeout: Optional request timeout in seconds.

Returns:
Expand Down Expand Up @@ -841,7 +843,7 @@ def add_examples_to_dataset(
input_keys=input_keys,
output_keys=output_keys,
metadata_keys=metadata_keys,
dataset_description=None,
dataset_description=dataset_version_description,
action="append",
timeout=timeout,
)
Expand All @@ -851,7 +853,7 @@ def add_examples_to_dataset(
inputs=inputs,
outputs=outputs,
metadata=metadata,
dataset_description=None,
dataset_description=dataset_version_description,
action="append",
timeout=timeout,
)
Expand Down Expand Up @@ -1460,6 +1462,7 @@ async def add_examples_to_dataset(
inputs: Iterable[Mapping[str, Any]] = (),
outputs: Iterable[Mapping[str, Any]] = (),
metadata: Iterable[Mapping[str, Any]] = (),
dataset_version_description: Optional[str] = None,
timeout: Optional[int] = DEFAULT_TIMEOUT_IN_SECONDS,
) -> Dataset:
"""
Expand All @@ -1478,6 +1481,7 @@ async def add_examples_to_dataset(
inputs: List of dictionaries each corresponding to an example.
outputs: List of dictionaries each corresponding to an example.
metadata: List of dictionaries each corresponding to an example.
dataset_version_description: Optional description for the new dataset version.
timeout: Optional request timeout in seconds.

Returns:
Expand Down Expand Up @@ -1538,7 +1542,7 @@ async def add_examples_to_dataset(
input_keys=input_keys,
output_keys=output_keys,
metadata_keys=metadata_keys,
dataset_description=None,
dataset_description=dataset_version_description,
action="append",
timeout=timeout,
)
Expand All @@ -1548,7 +1552,7 @@ async def add_examples_to_dataset(
inputs=inputs,
outputs=outputs,
metadata=metadata,
dataset_description=None,
dataset_description=dataset_version_description,
action="append",
timeout=timeout,
)
Expand Down
1 change: 1 addition & 0 deletions src/phoenix/db/insertion/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ async def add_dataset_examples(
dataset_version_id = await insert_dataset_version(
session=session,
dataset_id=dataset_id,
description=description,
created_at=created_at,
user_id=user_id,
)
Expand Down
Loading