Skip to content

Commit

Permalink
fix: rm check get_python_source
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Sep 21, 2024
1 parent b13c664 commit 98d619d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/utils/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@

if TYPE_CHECKING:
from airflow.decorators.base import Task, TaskDecorator
DECORATORS = sorted(set(x for x in dir(task) if not x.startswith("_")) - {"skip_if", "run_if"})

_CONDITION_DECORATORS = frozenset({"skip_if", "run_if"})
_NO_SOURCE_DECORATORS = frozenset({"sensor"})
DECORATORS = sorted(
set(x for x in dir(task) if not x.startswith("_")) - _CONDITION_DECORATORS - _NO_SOURCE_DECORATORS
)
DECORATORS_USING_SOURCE = ("external_python", "virtualenv", "branch_virtualenv", "branch_external_python")


Expand Down Expand Up @@ -115,9 +120,6 @@ def f():

def parse_python_source(task: Task, custom_operator_name: str | None = None) -> str:
operator = task().operator
if not hasattr(operator, "get_python_source"):
pytest.skip(f"Operator {operator} does not have get_python_source method")

if custom_operator_name:
custom_operator_name = (
custom_operator_name if custom_operator_name.startswith("@") else f"@{custom_operator_name}"
Expand Down

0 comments on commit 98d619d

Please sign in to comment.