Skip to content

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

Merged
merged 13 commits into from
Feb 14, 2025
Merged

Retrieve all user datasets #65

merged 13 commits into from
Feb 14, 2025

Conversation

alanzhang25
Copy link
Collaborator

@alanzhang25 alanzhang25 commented Feb 12, 2025

@alanzhang25 alanzhang25 requested a review from JCamyre February 12, 2025 21:22
Copy link
Collaborator

@JCamyre JCamyre left a 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:
Copy link
Collaborator

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

Copy link
Collaborator Author

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

Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

see new changes

Returns:
EvalDataset: The retrieved dataset
"""
return EvalDataset.pull_all(self.judgment_api_key)
Copy link
Collaborator

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()

Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

see new changes

@alanzhang25 alanzhang25 force-pushed the az-all-user-db-endpoint branch from 031caa9 to 160df00 Compare February 13, 2025 20:31
Copy link
Collaborator

@JCamyre JCamyre left a 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.

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)
Copy link
Collaborator

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.

Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor

@SecroLoL SecroLoL left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@JCamyre JCamyre left a 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.

Copy link
Collaborator

@JCamyre JCamyre left a comment

Choose a reason for hiding this comment

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

UT's failed, please update these three tests to reflect how we shifted the responsibility of pushing/pulling to the EvalDatasetClient.

>       dataset.pull("test_alias")
E       AttributeError: 'EvalDataset' object has no attribute 'pull'

image

@alanzhang25 alanzhang25 force-pushed the az-all-user-db-endpoint branch from 1d3eb9b to 168180c Compare February 14, 2025 01:58
Copy link
Collaborator Author

@alanzhang25 alanzhang25 left a comment

Choose a reason for hiding this comment

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

Run UT

@alanzhang25 alanzhang25 merged commit d7cc3a9 into main Feb 14, 2025
3 checks passed
@alanzhang25 alanzhang25 deleted the az-all-user-db-endpoint branch March 25, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants