Rds Operator pass custom conn_id to superclass#51196
Conversation
providers/amazon/src/airflow/providers/amazon/aws/operators/rds.py
Outdated
Show resolved
Hide resolved
|
@o-nikolas I was just skimming through the other AWS operators to look for similar bugs and found that the operators for cloud formation, comprehend and glue still set the |
Yupp, that's a reasonable plan, would you like to put up a separate PR for that? |
Already opened it #51236 :) |
* Adjuste RDSHook to pass aws_conn_id to Hooks * Added tests for changes and changed name of defaul conn_id in in RdsBaseOperator * Fixed pre-commit errors * Removed unnecessary args from RDSBaseOperator
… adjust the default value of in base class to . - Add defensive test around adding more task instance states to keep of the MwaaTaskCompletedTrigger up to date. - Fix issue where of the MwaaTaskSensor derives to instead of type. - Modify documentation to clearly indicate that the MwaaTaskSensor is meant to sense tasks across different MWAA environments. - Make an optional parameter, where it defaults to the latest dag run. - Externally fetch the task ID variable. - Test the sensor while a DAG Run is still in progress.
* Adjuste RDSHook to pass aws_conn_id to Hooks * Added tests for changes and changed name of defaul conn_id in in RdsBaseOperator * Fixed pre-commit errors * Removed unnecessary args from RDSBaseOperator
… adjust the default value of in base class to . - Add defensive test around adding more task instance states to keep of the MwaaTaskCompletedTrigger up to date. - Fix issue where of the MwaaTaskSensor derives to instead of type. - Modify documentation to clearly indicate that the MwaaTaskSensor is meant to sense tasks across different MWAA environments. - Make an optional parameter, where it defaults to the latest dag run. - Externally fetch the task ID variable. - Test the sensor while a DAG Run is still in progress.
* Add MwaaTaskSensor to Amazon Provider Package * include pre-commit hooks * - Comply with PR #51196: explicitly pass to its superclass, and adjust the default value of in base class to . - Add defensive test around adding more task instance states to keep of the MwaaTaskCompletedTrigger up to date. - Fix issue where of the MwaaTaskSensor derives to instead of type. - Modify documentation to clearly indicate that the MwaaTaskSensor is meant to sense tasks across different MWAA environments. - Make an optional parameter, where it defaults to the latest dag run. - Externally fetch the task ID variable. - Test the sensor while a DAG Run is still in progress. * documentation update * Response to PR #51719 comments - Brought UPSTREAM_FAILED to a Terminal Task Instance State instead of an Intermediate State. - Added REMOVED to the list of successful terminal task instance states. - Iterate programmatically through successful, failure, and in progress states instead of hard-coding. * update tests * Remove duplicate pointer to mwaatasksensor docs * merge #53000 * Fix integration tests * removed unnecessary defensive tests for trigger acceptor states after #53000 merge * removed unnecessary defensive tests for trigger acceptor states after #53000 merge * remove State file from PR * Remove hard coding deferrable property * Remove unnecessary execute_complete function in sensor and instead use end_from_trigger * Correctly use end_from_trigger attribute * Correctly use end_from_trigger attibute for both dag run sensor and task sensor * Remove unnecessary import
* Add MwaaTaskSensor to Amazon Provider Package * include pre-commit hooks * - Comply with PR apache#51196: explicitly pass to its superclass, and adjust the default value of in base class to . - Add defensive test around adding more task instance states to keep of the MwaaTaskCompletedTrigger up to date. - Fix issue where of the MwaaTaskSensor derives to instead of type. - Modify documentation to clearly indicate that the MwaaTaskSensor is meant to sense tasks across different MWAA environments. - Make an optional parameter, where it defaults to the latest dag run. - Externally fetch the task ID variable. - Test the sensor while a DAG Run is still in progress. * documentation update * Response to PR apache#51719 comments - Brought UPSTREAM_FAILED to a Terminal Task Instance State instead of an Intermediate State. - Added REMOVED to the list of successful terminal task instance states. - Iterate programmatically through successful, failure, and in progress states instead of hard-coding. * update tests * Remove duplicate pointer to mwaatasksensor docs * merge apache#53000 * Fix integration tests * removed unnecessary defensive tests for trigger acceptor states after apache#53000 merge * removed unnecessary defensive tests for trigger acceptor states after apache#53000 merge * remove State file from PR * Remove hard coding deferrable property * Remove unnecessary execute_complete function in sensor and instead use end_from_trigger * Correctly use end_from_trigger attribute * Correctly use end_from_trigger attibute for both dag run sensor and task sensor * Remove unnecessary import
* Add MwaaTaskSensor to Amazon Provider Package * include pre-commit hooks * - Comply with PR apache#51196: explicitly pass to its superclass, and adjust the default value of in base class to . - Add defensive test around adding more task instance states to keep of the MwaaTaskCompletedTrigger up to date. - Fix issue where of the MwaaTaskSensor derives to instead of type. - Modify documentation to clearly indicate that the MwaaTaskSensor is meant to sense tasks across different MWAA environments. - Make an optional parameter, where it defaults to the latest dag run. - Externally fetch the task ID variable. - Test the sensor while a DAG Run is still in progress. * documentation update * Response to PR apache#51719 comments - Brought UPSTREAM_FAILED to a Terminal Task Instance State instead of an Intermediate State. - Added REMOVED to the list of successful terminal task instance states. - Iterate programmatically through successful, failure, and in progress states instead of hard-coding. * update tests * Remove duplicate pointer to mwaatasksensor docs * merge apache#53000 * Fix integration tests * removed unnecessary defensive tests for trigger acceptor states after apache#53000 merge * removed unnecessary defensive tests for trigger acceptor states after apache#53000 merge * remove State file from PR * Remove hard coding deferrable property * Remove unnecessary execute_complete function in sensor and instead use end_from_trigger * Correctly use end_from_trigger attribute * Correctly use end_from_trigger attibute for both dag run sensor and task sensor * Remove unnecessary import
* Add MwaaTaskSensor to Amazon Provider Package * include pre-commit hooks * - Comply with PR apache#51196: explicitly pass to its superclass, and adjust the default value of in base class to . - Add defensive test around adding more task instance states to keep of the MwaaTaskCompletedTrigger up to date. - Fix issue where of the MwaaTaskSensor derives to instead of type. - Modify documentation to clearly indicate that the MwaaTaskSensor is meant to sense tasks across different MWAA environments. - Make an optional parameter, where it defaults to the latest dag run. - Externally fetch the task ID variable. - Test the sensor while a DAG Run is still in progress. * documentation update * Response to PR apache#51719 comments - Brought UPSTREAM_FAILED to a Terminal Task Instance State instead of an Intermediate State. - Added REMOVED to the list of successful terminal task instance states. - Iterate programmatically through successful, failure, and in progress states instead of hard-coding. * update tests * Remove duplicate pointer to mwaatasksensor docs * merge apache#53000 * Fix integration tests * removed unnecessary defensive tests for trigger acceptor states after apache#53000 merge * removed unnecessary defensive tests for trigger acceptor states after apache#53000 merge * remove State file from PR * Remove hard coding deferrable property * Remove unnecessary execute_complete function in sensor and instead use end_from_trigger * Correctly use end_from_trigger attribute * Correctly use end_from_trigger attibute for both dag run sensor and task sensor * Remove unnecessary import
Fixes #50766
I have adjusted the
RdsBaseOperatorclass to explicitly pass theaws_conn_idto its superclass, such that if a custom conn_id is provided the super class does not fall back to the default and the base classes receive the correct conn_id.Moreover I have adjusted the name of the default value of the aws_conn_id in RdsBaseOperator from
aws_conn_idtoaws_default, to be consistent with the RdsBaseOperator and all other operators.