Skip to content

fix: Worker should only fetch async jobs#109

Open
carlosgjs wants to merge 1 commit intoRolnickLab:mainfrom
carlosgjs:carlos/issue1111
Open

fix: Worker should only fetch async jobs#109
carlosgjs wants to merge 1 commit intoRolnickLab:mainfrom
carlosgjs:carlos/issue1111

Conversation

@carlosgjs
Copy link
Contributor

@carlosgjs carlosgjs commented Feb 6, 2026

This pull request introduces a new backend type for machine learning job execution and updates job fetching logic to only retrieve jobs intended for asynchronous processing.

Modified the get_jobs function in trapdata/antenna/client.py to filter jobs by the backend parameter, ensuring only jobs meant for async processing are fetched (MLBackend.ASYNC_API).

See corresponding antenna fix: RolnickLab/antenna#1118, it needs to be merged and deployed before this PR.

Tested against the above PR in antenna.

Summary by CodeRabbit

  • New Features
    • Added backend type selection for job retrieval and management. Users can now filter jobs based on their execution mode, with support for both synchronous and asynchronous processing workflows. This enhancement provides improved control over job processing strategies and enables targeting of async-processing jobs specifically.

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

A new MLBackend enum-like class was introduced with two backend type constants (SYNC_API and ASYNC_API), and the job-fetching request was updated to filter jobs using the ASYNC_API backend parameter.

Changes

Cohort / File(s) Summary
Backend Type Definition
trapdata/antenna/schemas.py
New MLBackend class added as a string subclass with two constants: SYNC_API and ASYNC_API for distinguishing job execution modes.
Client Job Filtering
trapdata/antenna/client.py
Import of MLBackend added; get_jobs request now includes backend parameter set to MLBackend.ASYNC_API to filter async-processing jobs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A backend type hops into view,
With ASYNC running swift and true,
Jobs now filter by their way,
Constants gleam in schemas' display! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: Worker should only fetch async jobs' directly and clearly summarizes the main change: filtering the worker to retrieve only asynchronous jobs via the MLBackend.ASYNC_API parameter.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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