-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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 two operators in AWS Providers: RedshiftResumeClusterOperator and RedshiftPauseClusterOperator #19665
Add two operators in AWS Providers: RedshiftResumeClusterOperator and RedshiftPauseClusterOperator #19665
Conversation
…ilar to the aws ec2 hook, this commit implements a wait_for_state function in the redshift hook module. Additionally we are implementing two new Operators: RedshiftResumeClusterOperator and RedshiftPauseClusterOperator. These operators will let developers leverage Airflow to resume and pause Redshift clusters before/after loading data to optimize for costs.
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
… files, run isort, and add new operators to the amazon provider.yaml
airflow/providers/amazon/aws/operators/redshift_pause_cluster.py
Outdated
Show resolved
Hide resolved
…rings and remove `wait_for_state` method in favor of the sensor at `airflow/providers/amazon/aws/sensors/redshift.py`
WDYT about information about these new operators to the existing AWS operator docs? https://github.com/apache/airflow/tree/main/docs/apache-airflow-providers-amazon/operators |
airflow/providers/amazon/aws/operators/redshift_pause_cluster.py
Outdated
Show resolved
Hide resolved
airflow/providers/amazon/aws/operators/redshift_pause_cluster.py
Outdated
Show resolved
Hide resolved
…` method instead of doing the cast in all Operators that use the function.
… and change type of `target_status`
… and change type of `target_status`
airflow/providers/amazon/aws/operators/redshift_pause_cluster.py
Outdated
Show resolved
Hide resolved
airflow/providers/amazon/aws/operators/redshift_resume_cluster.py
Outdated
Show resolved
Hide resolved
airflow/providers/amazon/aws/operators/redshift_resume_cluster.py
Outdated
Show resolved
Hide resolved
airflow/providers/amazon/aws/operators/redshift_pause_cluster.py
Outdated
Show resolved
Hide resolved
airflow/providers/amazon/aws/operators/redshift_resume_cluster.py
Outdated
Show resolved
Hide resolved
tests/providers/amazon/aws/operators/test_redshift_pause_cluster.py
Outdated
Show resolved
Hide resolved
tests/providers/amazon/aws/operators/test_redshift_pause_cluster.py
Outdated
Show resolved
Hide resolved
tests/providers/amazon/aws/operators/test_redshift_resume_cluster.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Daniel Standish <[email protected]>
Co-authored-by: Daniel Standish <[email protected]>
…erators' into redshift-resume-pause-cluster-operators
Co-authored-by: Daniel Standish <[email protected]>
Co-authored-by: Daniel Standish <[email protected]>
Co-authored-by: Daniel Standish <[email protected]>
Co-authored-by: Daniel Standish <[email protected]>
airflow/providers/amazon/aws/operators/redshift_resume_cluster.py
Outdated
Show resolved
Hide resolved
…erators' into redshift-resume-pause-cluster-operators # Conflicts: # airflow/providers/amazon/aws/sensors/redshift.py # docs/apache-airflow-providers-amazon/operators/redshift.rst
Co-authored-by: Daniel Standish <[email protected]>
Co-authored-by: Daniel Standish <[email protected]>
…erators' into redshift-resume-pause-cluster-operators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two comments should also be applied to the pause cluster case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small fixups
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work, and thanks for bearing with all the changes.
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to take another look at module names
Awesome work, congrats on your first merged pull request! |
This commit adds new exciting features to the Airflow AWS Redshift module:
New Operators to manage the status of a Redshift Cluster
We are implementing two new Operators:
RedshiftResumeClusterOperator
andRedshiftPauseClusterOperator
. These operators will let developers leverage Airflow to resume and pause Redshift clusters before/after loading data to optimize for costs.