Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
AllBatchConfigKeys,
BatchJob,
BatchJobCollection,
BatchJobWorkloadKey,
BatchQueuedJob,
)
from airflow.utils.state import State
Expand Down Expand Up @@ -402,9 +403,7 @@ def _describe_jobs(self, job_ids) -> list[BatchJob]:
all_jobs.extend(describe_workloads_response["jobs"])
return all_jobs

def execute_async(
self, key: TaskInstanceKey | str, command: CommandType, queue=None, executor_config=None
):
def execute_async(self, key: BatchJobWorkloadKey, command: CommandType, queue=None, executor_config=None):
"""Save the workload to be executed in the next sync using Boto3's RunTask API."""
if executor_config and "command" in executor_config:
raise ValueError('Executor Config should never override "command"')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,12 @@ def test_invalid_executor_config(self, mock_get_kube_client, mock_kubernetes_job
try:
assert executor.event_buffer == {}
executor.execute_async(
key=("dag", "task", timezone.utcnow(), 1),
key=TaskInstanceKey(
dag_id="dag",
task_id="task",
run_id="run",
try_number=1,
),
queue=None,
command=["airflow", "tasks", "run", "true", "some_parameter"],
executor_config=k8s.V1Pod(
Expand Down
Loading