Skip to content

Commit

Permalink
Turn common.io xcom exception into OptionalProviderFeatureException (a…
Browse files Browse the repository at this point in the history
…pache#38543)

The common.io xcom exception should be Optional Provider Feature.
When it's not, it's raising a compatiblity error when run on Airflow
< 2.9.0.
  • Loading branch information
potiuk authored and Mathia Haure-Touze committed Apr 4, 2024
1 parent b335f5b commit 7199630
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion airflow/providers/common/io/xcom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import packaging.version

from airflow.exceptions import AirflowOptionalProviderFeatureException

try:
from airflow import __version__ as airflow_version
except ImportError:
Expand All @@ -26,7 +28,7 @@
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
"2.9.0"
):
raise RuntimeError(
raise AirflowOptionalProviderFeatureException(
"The package xcom backend feature of `apache-airflow-providers-common-io` needs "
"Apache Airflow 2.9.0+"
)

0 comments on commit 7199630

Please sign in to comment.