Пример #1
0
def patch_airflow_context_vars():
    """ used for tracking bash operators """
    import airflow
    from airflow.utils import operator_helpers
    from dbnd_airflow.airflow_override.operator_helpers import context_to_airflow_vars

    from dbnd._core.utils.object_utils import patch_models

    if hasattr(airflow.utils.operator_helpers, "context_to_airflow_vars"):
        patches = [(
            airflow.utils.operator_helpers,
            "context_to_airflow_vars",
            context_to_airflow_vars,
        )]
        patch_models(patches)
Пример #2
0
def patch_airflow_context_vars():
    """Used for tracking bash operators"""
    import airflow

    from dbnd._core.utils.object_utils import patch_models
    from dbnd_airflow.airflow_override.operator_helpers import context_to_airflow_vars

    import airflow.models.taskinstance  # isort:skip

    modules_to_patch = [
        airflow.utils.operator_helpers, airflow.models.taskinstance
    ]
    patches = []
    for module in modules_to_patch:
        if hasattr(module, "context_to_airflow_vars"):
            patches.append(
                (module, "context_to_airflow_vars", context_to_airflow_vars))
    patch_models(patches)
Пример #3
0
def patch_airflow_windows_support():
    from dbnd._core.utils.object_utils import patch_models
    patch_models(get_windows_compatible_patches())
Пример #4
0
def patch_airflow_modules():
    patch_models(get_airflow_patches())