Skip to content

Commit

Permalink
refactor: DatasetDict to ExampleDatasets dataclass (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
axiomofjoy authored Mar 26, 2023
1 parent 171ba2b commit 70d687e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/phoenix/datasets/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,17 @@ def _download_and_persist_dataset_if_missing(
return dataset


class DatasetDict(dict): # type: ignore
@dataclass
class ExampleDatasets:
"""
A dictionary of datasets, split out by dataset type (primary, reference).
A pair of example primary and reference datasets.
"""

primary: Dataset
reference: Dataset


def load_example(use_case: str) -> DatasetDict:
def load_example(use_case: str) -> ExampleDatasets:
"""
Loads an example primary and reference dataset for a given use-case.
Expand All @@ -361,4 +362,4 @@ def load_example(use_case: str) -> DatasetDict:
print(f"📥 Loaded {use_case} example datasets.")
print("ℹ️ About this use-case:")
print(fixture.description)
return DatasetDict(primary=primary_dataset, reference=reference_dataset)
return ExampleDatasets(primary=primary_dataset, reference=reference_dataset)

0 comments on commit 70d687e

Please sign in to comment.