Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The point of this helper is to make it simpler to figure out what airflow version is installed, in particular to implement conditional logic in providers. Currently the logic is too complicated and this has resulted in the proliferation of sort of redundant constants. Here's an example: ``` from airflow import __version__ as AIRFLOW_VERSION AIRFLOW_V_3_0_PLUS = Version(Version(AIRFLOW_VERSION).base_version) >= Version("3.0.0") if AIRFLOW_V_3_0_PLUS: from airflow.sdk.definitions.asset import Asset ``` With this helper, we can do this instead: ``` from airflow import get_airflow_version if get_airflow_version() > Version("3.0.0"): from airflow.sdk.definitions.asset import Asset ```
- Loading branch information