v4xsh commented on issue #61418:
URL: https://github.com/apache/airflow/issues/61418#issuecomment-3847300044

   
     Hi @jscheffl  I’d like to work on this. I’ve looked into the `ASYNC240` 
rule and the discussion regarding the dependency quorum for Airflow 3.
     
     The issue is that `pathlib` methods like `.exists()` and `.is_file()` are 
synchronous and block the event loop when called inside `async` functions. To 
re-enable the rule, we need to offload these calls to a thread or use an async 
filesystem wrapper.
     
     **Regarding the library choice mentioned in the description:**
     
     * **AnyIO**: We could use `anyio.to_thread.run_sync` to wrap the `pathlib` 
calls. This is a surgical fix that doesn't require a full filesystem refactor.
     * **Trio/Aiofiles**: These provide native async path objects but would add 
a more significant dependency for the core.
     
     I’m happy to implement whichever approach the maintainers prefer to get 
this rule re-enabled. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to