Repository: apache/airflow
File: providers/common/compat/src/airflow/providers/common/compat/sdk.py (Python)

Code before:
        task_group as task_group,
        teardown as teardown,
    )
    from airflow.sdk.bases.decorator import (
        DecoratedMappedOperator as DecoratedMappedOperator,
        DecoratedOperator as DecoratedOperator,
        TaskDecorator as TaskDecorator,
        get_unique_task_id as get_unique_task_id,
        task_decorator_factory as task_decorator_factory,
    )
    from airflow.sdk.bases.sensor import poke_mode_only as poke_mode_only
    from airflow.sdk.definitions.context import context_merge as context_merge
    from airflow.sdk.definitions.mappedoperator import MappedOperator as MappedOperator
    from airflow.sdk.definitions.template import literal as literal
    from airflow.sdk.exceptions import (
        AirflowException as AirflowException,
        AirflowFailException as AirflowFailException,
        AirflowNotFoundException as AirflowNotFoundException,
        AirflowSensorTimeout as AirflowSensorTimeout,
        AirflowSkipException as AirflowSkipException,
        AirflowTaskTimeout as AirflowTaskTimeout,
        ParamValidationError as ParamValidationError,
        TaskDeferred as TaskDeferred,
        XComNotFound as XComNotFound,
    )
    from airflow.sdk.log import redact as redact
    from airflow.sdk.observability.stats import Stats  # noqa: F401

    # Airflow 3-only exceptions (conditionally imported)
    if AIRFLOW_V_3_0_PLUS:
        from airflow.sdk.exceptions import (
            DagRunTriggerException as DagRunTriggerException,
            DownstreamTasksSkipped as DownstreamTasksSkipped,
        )
    from airflow.sdk.execution_time.context import (
        AIRFLOW_VAR_NAME_FORMAT_MAPPING as AIRFLOW_VAR_NAME_FORMAT_MAPPING,
        context_to_airflow_vars as context_to_airflow_vars,
    )
    from airflow.sdk.execution_time.timeout import timeout as timeout
    from airflow.sdk.execution_time.xcom import XCom as XCom


from airflow.providers.common.compat._compat_utils import create_module_getattr

# Rename map for classes that changed names between Airflow 2.x and 3.x
# Format: new_name -> (new_path, old_path, old_name)
_RENAME_MAP: dict[str, tuple[str, str, str]] = {
    # Assets: Dataset -> Asset rename in Airflow 3.0
    "Asset": ("airflow.sdk", "airflow.datasets", "Dataset"),
    "AssetAlias": ("airflow.sdk", "airflow.datasets", "DatasetAlias"),
    "AssetAll": ("airflow.sdk", "airflow.datasets", "DatasetAll"),

Review comment (suggestion):
```suggestion
    from airflow.sdk.log import redact
```

Code after:
        task_group as task_group,
        teardown as teardown,
    )
    from airflow.sdk.bases.decorator import (
        DecoratedMappedOperator as DecoratedMappedOperator,
        DecoratedOperator as DecoratedOperator,
        TaskDecorator as TaskDecorator,
        get_unique_task_id as get_unique_task_id,
        task_decorator_factory as task_decorator_factory,
    )
    from airflow.sdk.bases.sensor import poke_mode_only as poke_mode_only
    from airflow.sdk.definitions.context import context_merge as context_merge
    from airflow.sdk.definitions.mappedoperator import MappedOperator as MappedOperator
    from airflow.sdk.definitions.template import literal as literal
    from airflow.sdk.exceptions import (
        AirflowException as AirflowException,
        AirflowFailException as AirflowFailException,
        AirflowNotFoundException as AirflowNotFoundException,
        AirflowSensorTimeout as AirflowSensorTimeout,
        AirflowSkipException as AirflowSkipException,
        AirflowTaskTimeout as AirflowTaskTimeout,
        ParamValidationError as ParamValidationError,
        TaskDeferred as TaskDeferred,
        XComNotFound as XComNotFound,
    )
    from airflow.sdk.log import redact as redact
    from airflow.sdk.observability.stats import Stats as Stats

    # Airflow 3-only exceptions (conditionally imported)
    if AIRFLOW_V_3_0_PLUS:
        from airflow.sdk.exceptions import (
            DagRunTriggerException as DagRunTriggerException,
            DownstreamTasksSkipped as DownstreamTasksSkipped,
        )
    from airflow.sdk.execution_time.context import (
        AIRFLOW_VAR_NAME_FORMAT_MAPPING as AIRFLOW_VAR_NAME_FORMAT_MAPPING,
        context_to_airflow_vars as context_to_airflow_vars,
    )
    from airflow.sdk.execution_time.timeout import timeout as timeout
    from airflow.sdk.execution_time.xcom import XCom as XCom


from airflow.providers.common.compat._compat_utils import create_module_getattr

# Rename map for classes that changed names between Airflow 2.x and 3.x
# Format: new_name -> (new_path, old_path, old_name)
_RENAME_MAP: dict[str, tuple[str, str, str]] = {
    # Assets: Dataset -> Asset rename in Airflow 3.0
    "Asset": ("airflow.sdk", "airflow.datasets", "Dataset"),
    "AssetAlias": ("airflow.sdk", "airflow.datasets", "DatasetAlias"),
    "AssetAll": ("airflow.sdk", "airflow.datasets", "DatasetAll"),