-
Notifications
You must be signed in to change notification settings - Fork 83
Retrieve all user datasets #65
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid! A couple tweaks.
@@ -152,6 +152,57 @@ def pull(self, alias: str): | |||
description=f"{progress.tasks[task_id].description} [rgb(25,227,160)]Done!)", | |||
) | |||
|
|||
def pull_all(judgment_api_key: str) -> dict: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this a method of the EvalDataset class by adding the self
parameter and removing the judgment_api_key
parameter, this is already an EvalDataset attribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops I forgot to include part of my change, I actually had a @staticmethod on this because it didn't make a lot of sense to me for pull_all to be a instance method of EvalDataset because it is returning multiple 'EvalDataset'. Lmk ur thoughts on this though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick clarification -- if we are retrieving multiple datasets, shouldn't this be a method under the JudgmentClient
object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see new changes
src/judgeval/judgment_client.py
Outdated
Returns: | ||
EvalDataset: The retrieved dataset | ||
""" | ||
return EvalDataset.pull_all(self.judgment_api_key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do something similar here:
dataset = EvalDataset(judgment_api_key=self.judgment_api_key)
dataset.pull_all()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the point that we're actually getting all user EvalDatasets
? Why is this function returning a single EvalDataset
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see new changes
031caa9
to
160df00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming/commenting conventions, as well as an e2etest change.
src/e2etests/judgment_client_test.py
Outdated
def test_pull_all_datasets(self, client: JudgmentClient): | ||
dataset: EvalDataset = client.create_dataset() | ||
# dataset.add_example(Example(input="input 1", actual_output="output 1")) | ||
# client.push_dataset(alias="test_dataset_6", dataset=dataset, overwrite=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to create a unique dataset (using a random name for the alias
), and then add a few examples and ground truths to it, then check the count (the count should match based on how many examples and ground truths you added).
The issue with the current test is that it relies on everyone who is running the e2etest to have the test_dataset_6
and test_dataset_7
in their account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this file probably belongs in src/judgeval/data/datasets/
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just reroute the imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for making the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1d3eb9b
to
168180c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run UT
e2e test:
https://www.notion.so/18fe6c8347d680f9bb71c6361febab5f?v=18fe6c8347d6816e8a01000c1dbebebf&p=18fe6c8347d6804181a6e72d200869e6&pm=s