vincbeck commented on code in PR #64770:
URL: https://github.com/apache/airflow/pull/64770#discussion_r3073359387
##########
providers/amazon/src/airflow/providers/amazon/aws/operators/emr.py:
##########
@@ -604,10 +610,19 @@ def check_failure(self, query_status):
def execute_complete(self, context: Context, event: dict[str, Any] | None
= None) -> str:
validated_event = validate_execute_complete_event(event)
- if validated_event["status"] != "success":
- raise AirflowException(f"Error while running job:
{validated_event}")
-
- return validated_event["job_id"]
+ if validated_event["status"] == "success":
+ return validated_event["job_id"]
+ job_id = validated_event.get("job_id") or self.job_id
Review Comment:
Never use `self.job_id` in `execute_complete`. The worker/machine running
`execute` and `execute_complete` could be very different, hence you should not
assume `self.job_id` is defined
```suggestion
job_id = validated_event.get("job_id")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]