Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Airflow 3 Deprecation Warning dependency in OTel Provider #46600

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading