Skip to content

Commit

Permalink
base excutor deprecated unused validate_command function removal (apa…
Browse files Browse the repository at this point in the history
  • Loading branch information
dirrao authored Aug 18, 2024
1 parent 8652209 commit 55e6099
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
18 changes: 0 additions & 18 deletions airflow/executors/base_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import logging
import sys
import warnings
from collections import defaultdict, deque
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, List, Optional, Sequence, Tuple
Expand All @@ -29,7 +28,6 @@

from airflow.cli.cli_config import DefaultHelpParser
from airflow.configuration import conf
from airflow.exceptions import RemovedInAirflow3Warning
from airflow.executors.executor_loader import ExecutorLoader
from airflow.models import Log
from airflow.stats import Stats
Expand Down Expand Up @@ -584,22 +582,6 @@ def slots_occupied(self):
"""Number of tasks this executor instance is currently managing."""
return len(self.running) + len(self.queued_tasks)

@staticmethod
def validate_command(command: list[str]) -> None:
"""
Back-compat method to Check if the command to execute is airflow command.
:param command: command to check
"""
warnings.warn(
"""
The `validate_command` method is deprecated. Please use ``validate_airflow_tasks_run_command``
""",
RemovedInAirflow3Warning,
stacklevel=2,
)
BaseExecutor.validate_airflow_tasks_run_command(command)

@staticmethod
def validate_airflow_tasks_run_command(command: list[str]) -> tuple[str | None, str | None]:
"""
Expand Down
8 changes: 0 additions & 8 deletions tests/executors/test_base_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,6 @@ def test_empty_airflow_tasks_run_command(generate_command_mock, dag_maker):
assert dag_id is None, task_id is None


@pytest.mark.db_test
def test_deprecate_validate_api(dag_maker):
dagrun = setup_dagrun(dag_maker)
tis = dagrun.task_instances
with pytest.warns(DeprecationWarning):
BaseExecutor.validate_command(tis[0].command_as_list())


def test_debug_dump(caplog):
executor = BaseExecutor()
with caplog.at_level(logging.INFO):
Expand Down

0 comments on commit 55e6099

Please sign in to comment.