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

feat: add a fixed number of rows to take importing dataset from Hub #5597

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion argilla-server/src/argilla_server/jobs/hub_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
# TODO: Move this to be defined on jobs queues as a shared constant
JOB_TIMEOUT_DISABLED = -1

HUB_DATASET_TAKE_ROWS = 500_000
jfcalvo marked this conversation as resolved.
Show resolved Hide resolved


# TODO: Once we merge webhooks we should change the queue to use a different one (default queue is deleted there)
@job(DEFAULT_QUEUE, timeout=JOB_TIMEOUT_DISABLED, retry=Retry(max=3))
Expand All @@ -47,4 +49,8 @@
async with SearchEngine.get_by_name(settings.search_engine) as search_engine:
parsed_mapping = HubDatasetMapping.parse_obj(mapping)

await HubDataset(name, subset, split, parsed_mapping).import_to(db, search_engine, dataset)
await (

Check warning on line 52 in argilla-server/src/argilla_server/jobs/hub_jobs.py

View check run for this annotation

Codecov / codecov/patch

argilla-server/src/argilla_server/jobs/hub_jobs.py#L52

Added line #L52 was not covered by tests
HubDataset(name, subset, split, parsed_mapping)
.take(HUB_DATASET_TAKE_ROWS)
.import_to(db, search_engine, dataset)
)