Skip to content

Commit

Permalink
Remove Airflow 3 Deprecation Warning dependency in OTel Provoder
Browse files Browse the repository at this point in the history
  • Loading branch information
jscheffl committed Feb 9, 2025
1 parent 1baa752 commit 470b64e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
from airflow.providers.openlineage.version_compat import AIRFLOW_V_2_10_PLUS, AIRFLOW_V_3_0_PLUS
from airflow.sensors.base import BaseSensorOperator
from airflow.serialization.serialized_objects import SerializedBaseOperator
from airflow.utils.context import AirflowContextDeprecationWarning
from airflow.utils.module_loading import import_string
from airflow.utils.session import NEW_SESSION, provide_session
from openlineage.client.utils import RedactMixin
Expand Down Expand Up @@ -640,6 +639,13 @@ def from_masker(cls, other: SecretsMasker) -> OpenLineageRedactor:
return instance

def _redact(self, item: Redactable, name: str | None, depth: int, max_depth: int) -> Redacted:
if AIRFLOW_V_3_0_PLUS:
# Keep compatibility for Airflow 2.x, remove when Airflow 3.0 is the minimum version
class AirflowContextDeprecationWarning(UserWarning):
pass
else:
from airflow.utils.context import AirflowContextDeprecationWarning

if depth > max_depth:
return item
try:
Expand Down

0 comments on commit 470b64e

Please sign in to comment.