You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "sundeep8967 (via GitHub)" <gi...@apache.org> on 2026/08/25 20:44:40 UTC
[PR] Fix AsyncToSync error in Databricks deferrable operators [airflow]
sundeep8967 opened a new pull request, #72077:
URL: https://github.com/apache/airflow/pull/72077
## Problem
The `DatabricksRunNowOperator(deferrable=True)` crashes during trigger polling in Airflow 3 because it attempts to lazily fetch the Databricks connection (via `self.databricks_conn`) from within an actively running `asyncio` event loop. The connection fetch path routes through `SUPERVISOR_COMMS.send` which uses `asgiref.sync.async_to_sync`, resulting in a hard `RuntimeError`.
## Solution
This PR implements an async-safe mechanism for retrieving the connection (`get_a_databricks_conn`) and updates all async functions within `BaseDatabricksHook` to use it instead of the synchronous property.
Fixes #71525
## Testing
- Unit tests updated and verified.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix AsyncToSync error in Databricks deferrable operators [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #72077:
URL: https://github.com/apache/airflow/pull/72077#issuecomment-5416526898
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our [Contributors' Guide](https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:
- Pay attention to the quality of your code (ruff, mypy and type annotations). Our [prek-hooks]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-prek-hooks) will help you with that.
- In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example Dag that shows how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
- Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
- Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
- Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
- Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
Apache Airflow is a community-driven project and together we are making it better 🚀.
In case of doubts contact the developers at:
Mailing List: dev@airflow.apache.org
Slack: https://s.apache.org/airflow-slack
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix AsyncToSync error in Databricks deferrable operators [airflow]
Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil closed pull request #72077: Fix AsyncToSync error in Databricks deferrable operators
URL: https://github.com/apache/airflow/pull/72077
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix AsyncToSync error in Databricks deferrable operators [airflow]
Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil commented on PR #72077:
URL: https://github.com/apache/airflow/pull/72077#issuecomment-5942552419
Closing this. The new tests patch the async `get_a_databricks_conn` with `PropertyMock`, so awaiting it calls the `Connection` and fails (`TypeError: 'Connection' object is not callable`), and 9 checks fail. `_a_get_sp_token` and `_a_get_aad_token` also still read the sync `databricks_conn`. On #71525 the crash was confirmed to affect only 3.0.x and be fixed in core from 3.1.0, and #71840 is the further-along PR for it.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org