Skip to content

Commit

Permalink
Fix: Tests after apache#41549 (Keep compatibility with old FAB versions)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopamaral committed Aug 27, 2024
1 parent 8bc594a commit 55e6a4d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/serialization/test_dag_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import pytest
from dateutil.relativedelta import FR, relativedelta
from kubernetes.client import models as k8s
from packaging import version as packaging_version

import airflow
from airflow.datasets import Dataset
Expand All @@ -58,6 +59,7 @@
from airflow.operators.bash import BashOperator
from airflow.operators.empty import EmptyOperator
from airflow.providers.cncf.kubernetes.pod_generator import PodGenerator
from airflow.providers.fab import __version__ as FAB_VERSION
from airflow.security import permissions
from airflow.sensors.bash import BashSensor
from airflow.serialization.dag_dependency import DagDependency
Expand Down Expand Up @@ -246,6 +248,11 @@ def detect_task_dependencies(task: Operator) -> DagDependency | None: # type: i
}
},
}
if packaging_version.parse(FAB_VERSION) >= packaging_version.parse("1.3.0")
else {
"__type": "set",
"__var": [permissions.ACTION_CAN_READ, permissions.ACTION_CAN_EDIT],
}
},
},
"edge_info": {},
Expand Down

0 comments on commit 55e6a4d

Please sign in to comment.