Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: convert DatasetDict to dict and add __repr__ for Dataset #425

Merged
merged 9 commits into from
Mar 23, 2023
3 changes: 3 additions & 0 deletions src/phoenix/datasets/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ def __init__(
self.to_disc()
logger.info(f"""Dataset: {self.__name} initialized""")

def __repr__(self) -> str:
return f'<Dataset "{self.name}">'

@cached_property
def start_time(self) -> datetime:
"""Returns the datetime of the earliest inference in the dataset"""
Expand Down
9 changes: 5 additions & 4 deletions src/phoenix/datasets/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import os
from dataclasses import dataclass, replace
from typing import Dict, Tuple
from typing import Tuple

from pandas import read_parquet

Expand Down Expand Up @@ -325,9 +325,10 @@ def _download_and_persist_dataset_if_missing(
return dataset


@dataclass(frozen=True)
class DatasetDict(Dict[str, Dataset]):
"""A dictionary of datasets, split out by dataset type (primary, reference)."""
class DatasetDict(dict): # type: ignore
"""
A dictionary of datasets, split out by dataset type (primary, reference).
"""

primary: Dataset
reference: Dataset
Expand Down