Skip to content

Fix ASYNC240 rule findings #61418

@jscheffl

Description

@jscheffl

Apache Airflow version

main (development)

If "Other Airflow 3 version" selected, which one?

No response

What happened?

PR #61417 with upgrading Ruff version to 0.15.0 enabled rule ASYNC240 per default. Some occurrences and findings make the code not compatible.

Nevertheless the rule seems to make sense in general not blocking async code by IO requests.

What you think should happen instead?

Rule should be re-enabled and code locations should be optimized.

NOTE: It is to be decided which of the two libraries to use and it seems this is adding a new dependency. So a short cal to maintainers is needed to get a quorum which to pick.

How to reproduce

Remove exclusion of rule ASYNC240 as it was added by e3c727c in pyproject.toml, run ruff in the repo to see cases where code needs to be fixed.
Follow descriptions in https://docs.astral.sh/ruff/rules/blocking-path-method-in-async-function/#blocking-path-method-in-async-function-async240

Operating System

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions