-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow Legacy SqlSensor to use the common.sql providers (#25293)
The legacy Airflow SqlSensor, rejects working wiht comon.sql providers eve if they are perfectly fine to use. While users could switch to the common.sql sensor (and it should work fine). we should not force the users to switch to it. We are implementing "fake" class hierarchy in case the provider is installed on Airflow 2.3 and below. In case of Airflow 2.4+ importing the old DbApiHook will fail, because it will cause a circular import - in such case our new DbApiHook will derive (as it was originally planned) from BaseHook. But In case of Airflow 2.3 and below such import will succeed and we are using the original DbApiHook from airflow.hooks.dbapi as base class - this way any "common.sql" hook on Airflow 2.3 and below will also derive from the airlfow.hooks.dbapi.DbApiHook - thus it will be possible to use it by the original SqlSensor. Fixes: #25274
- Loading branch information
Showing
2 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters