Skip to content

[ENH] Make better use of concurrency#288

Merged
PGijsbers merged 3 commits intomainfrom
maint/parallel
Mar 24, 2026
Merged

[ENH] Make better use of concurrency#288
PGijsbers merged 3 commits intomainfrom
maint/parallel

Conversation

@PGijsbers
Copy link
Contributor

We recently made the switch to use asyncio for our database connection and API clients. The change was made with as little changes as possible, which means that there were multiple call sites where async calls could be sent off and awaited together instead of in sequence.

@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 31.25000% with 11 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@5c30ef7). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/routers/openml/setups.py 20.00% 4 Missing ⚠️
src/routers/openml/tasks.py 25.00% 3 Missing ⚠️
src/routers/openml/datasets.py 33.33% 2 Missing ⚠️
src/routers/mldcat_ap/dataset.py 50.00% 1 Missing ⚠️
src/routers/openml/flows.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #288   +/-   ##
=======================================
  Coverage        ?   54.12%           
=======================================
  Files           ?       37           
  Lines           ?     1552           
  Branches        ?      135           
=======================================
  Hits            ?      840           
  Misses          ?      710           
  Partials        ?        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 24, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1054825d-2cbb-41ee-9ac4-8ec7e86a9dca

📥 Commits

Reviewing files that changed from the base of the PR and between 5c30ef7 and e5b354e.

📒 Files selected for processing (6)
  • src/routers/mldcat_ap/dataset.py
  • src/routers/openml/datasets.py
  • src/routers/openml/flows.py
  • src/routers/openml/setups.py
  • src/routers/openml/tasks.py
  • tests/routers/openml/migration/setups_migration_test.py

Walkthrough

This pull request refactors multiple router endpoint functions across the codebase to use concurrent data fetching via asyncio.gather instead of sequential awaits. Files modified include dataset.py, datasets.py, flows.py, setups.py, and tasks.py in the openml and mldcat_ap routers. Each modification replaces sequential database queries and API calls with concurrent execution. Additionally, corresponding migration tests in setups_migration_test.py are updated to execute API requests concurrently. The changes preserve existing normalization logic and return values while restructuring control flow for concurrency. No public entity declarations were modified.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title '[ENH] Make better use of concurrency' clearly summarizes the main change: improving concurrency by running independent async operations concurrently rather than sequentially across multiple routers and test files.
Description check ✅ Passed The description directly relates to the changeset, explaining that the project switched to asyncio and identifies the problem this PR addresses: multiple call sites where async calls should be awaited together instead of sequentially.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch maint/parallel

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@PGijsbers PGijsbers marked this pull request as ready for review March 24, 2026 15:33
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@PGijsbers PGijsbers merged commit 8e62afb into main Mar 24, 2026
8 of 9 checks passed
@PGijsbers PGijsbers deleted the maint/parallel branch March 24, 2026 15:38
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.

1 participant