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

Feature: Limits as part of the query #590

Merged
merged 5 commits into from
Feb 9, 2025
Merged

Conversation

kbolashev
Copy link
Member

This PR adds ability to make limits a part of a query with ds.limit(n).
This allows to save the limit as part of a dataset and/or an MLflow artifact.

Should allow for better reproducibility for cases where the user is using ds.head() to train on a subset.

This PR also adds a new ds.fetch() function, that respects this limiter AND also always log an MLflow artifact to an active run.

q = ds.limit(100)
q.fetch()      # Gets 100 datapoints, logs to mlflow
q.head(50)     # Gets 50 datapoints, doesn't log to mlflow
q.head(500)    # Gets 100 datapoints, doesn't log to mlflow
q.all()        # Gets ALL datapoints, the user will get a warning that there was a limit and it gotten overriden

Copy link

dagshub bot commented Feb 6, 2025

Copy link
Contributor

@simonlsk simonlsk left a comment

Choose a reason for hiding this comment

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

LGTM,
Would be good to have introspection here to check if the server supports limit.

Add queryInput introspection validation save_dataset()
@kbolashev kbolashev merged commit 4af9a0c into master Feb 9, 2025
8 checks passed
@kbolashev kbolashev deleted the enhancement/query-limit branch February 9, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants