Skip to content

Provide a stronger type hint for App.open_async()#1536

Merged
ewjoachim merged 1 commit into
procrastinate-org:mainfrom
aolieman:fix/remove-generic-unknown
Apr 8, 2026
Merged

Provide a stronger type hint for App.open_async()#1536
ewjoachim merged 1 commit into
procrastinate-org:mainfrom
aolieman:fix/remove-generic-unknown

Conversation

@aolieman
Copy link
Copy Markdown
Contributor

@aolieman aolieman commented Apr 7, 2026

This tiny contribution +[App] fixes a (based)pyright error. I believe this error is out of place for a project that is so well type-hinted.

Type of "open_async" is partially unknown
  Type of "open_async" is "(pool: Any | None = None) -> AwaitableContext[Unknown]"

Successful PR Checklist:

  • Tests
    • (not applicable?)
  • Documentation
    • (not applicable?)

PR label(s):

Summary by CodeRabbit

  • Refactor
    • Improved type specificity for the async context manager to provide more accurate type information for developers.

@aolieman aolieman requested a review from a team as a code owner April 7, 2026 22:01
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6a824e02-f1d2-411d-ab4d-e5010bbe1ba4

📥 Commits

Reviewing files that changed from the base of the PR and between a079ddf and a4317aa.

📒 Files selected for processing (1)
  • procrastinate/app.py

📝 Walkthrough

Walkthrough

The App.open_async method's return type annotation was updated to use a generic type parameter, changing from utils.AwaitableContext to utils.AwaitableContext[App], to explicitly indicate that the context manager returns an App instance.

Changes

Cohort / File(s) Summary
Type Annotation Enhancement
procrastinate/app.py
Updated App.open_async return type from utils.AwaitableContext to utils.AwaitableContext[App] for improved type specificity and clarity.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A tiny type, so precise and neat,
Now App declares what it will greet,
Generic parameters, oh what a sight,
The context manager shines so bright! ✨

🚥 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 accurately and concisely describes the main change: improving the type hint specificity for App.open_async() from generic AwaitableContext to AwaitableContext[App].
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 unit tests (beta)
  • Create PR with unit tests

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.

@ewjoachim ewjoachim enabled auto-merge April 8, 2026 06:16
@ewjoachim
Copy link
Copy Markdown
Member

Thank you very much

@ewjoachim ewjoachim merged commit 49ef824 into procrastinate-org:main Apr 8, 2026
17 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  procrastinate
  app.py
  connector.py
  jobs.py
  manager.py
  psycopg_connector.py
  sync_psycopg_connector.py
  tasks.py
  testing.py
  procrastinate/contrib/sqlalchemy
  psycopg2_connector.py
Project Total  

This report was generated by python-coverage-comment-action

@ewjoachim
Copy link
Copy Markdown
Member

https://github.com/procrastinate-org/procrastinate/releases/tag/3.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR type: miscellaneous 👾 Contains misc changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants