Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MwaaDagRunSensor to Amazon Provider Package #46945

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ramitkataria
Copy link
Contributor

@ramitkataria ramitkataria commented Feb 20, 2025

Includes the doc page, unit tests and system test

Support for deferrable mode will be added soon (in another PR)


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added the provider:amazon AWS/Amazon - related issues label Feb 20, 2025
Includes the doc page, unit tests and system test.

Support for deferrable mode will be added soon.
@ramitkataria ramitkataria force-pushed the ramitkataria/mwaa-dag-sensor branch from 4a59f3e to 6a9b286 Compare February 20, 2025 23:25
…erministic so that xdist execution doesn't fail
@ferruzzi
Copy link
Contributor

Added reviewers at Ramit's request.

Copy link
Contributor

@o-nikolas o-nikolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I left a few nits, but I wouldn't say they're merge blocking.

Comment on lines +44 to +45
s_states = {"state1", "state2"}
f_states = {"state3", "state4"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit: But I don't love single character variable names (or even components of a variable name with single characters). I think it's much cleaner an readable to have success_states and failure_states and it's really not thaaat much longer.

assert sensor.ext_env_name == SENSOR_KWARGS["external_env_name"]
assert sensor.ext_dag_id == SENSOR_KWARGS["external_dag_id"]
assert sensor.ext_dag_run_id == SENSOR_KWARGS["external_dag_run_id"]
assert set(sensor.success_states) == set(s_states)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Does the left side need the coercion to set? Don't you already do that inside the sensor init? And the s_states is already a set too?

Comment on lines +53 to +55
with pytest.raises(AirflowException):
MwaaDagRunSensor(
**SENSOR_KWARGS, success_states={"state1", "state2"}, failure_states={"state2", "state3"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This feels like a sad case tacked onto the end of a happy path unit test. Maybe split it out into it's own?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider:amazon AWS/Amazon - related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants