Skip to content

Refactor/Review EcsOperator #24826

@eladkal

Description

@eladkal

Body

After reading https://stackoverflow.com/questions/72630480/airflow-sensor-for-aws-ecs-task I checked the source code as it should have been relativly easy to get the functionality user is requesting but discovered that EcsOperator
seems like hook + operator + sensor in a single class which makes it harder to create a sensor as the user wishes.

For some reason we don't have EcsHook ? I didn't find reason why we don't have one or why the operator handle so much logic on it's own.

If we take for example:

def _wait_for_task_ended(self) -> None:

We probably should have a function in hook that checks for status so it will be easy to extend and reuse (if for example we want to create a Sensor).

The task:
Review the class and refactor what needs to be extract to EcsHook, maybe create also EcsSensor as part of the refactor?

FYI @ferruzzi @o-nikolas @vincbeck

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:providerskind:taskA task that needs to be completed as part of a larger issueprovider:amazonAWS/Amazon - related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions