SameerMesiah97 commented on code in PR #69786:
URL: https://github.com/apache/airflow/pull/69786#discussion_r3609676901
##########
providers/airbyte/src/airflow/providers/airbyte/sensors/airbyte.py:
##########
@@ -126,15 +126,16 @@ def execute(self, context: Context) -> Any:
)
def execute_complete(self, context: Context, event: Any = None) -> None:
- """
- Invoke this callback when the trigger fires; return immediately.
-
- Relies on trigger to throw an exception, otherwise it assumes
execution was
- successful.
- """
+ """Invoke this callback when the trigger fires and fail unless the job
succeeded."""
if event["status"] == "error":
self.log.debug("An error occurred with context: %s", context)
raise AirflowException(event["message"])
+ if event["status"] != "success":
Review Comment:
This fixes the immediate bug, but would it be clearer to handle cancelled
explicitly rather than treating every non-success state as a generic failure?
Since the trigger emits a well-defined set of terminal states, modelling those
explicitly (success, error, cancelled, and an else for unexpected statuses)
would be better. You can refer to the `execute_complete` method in the
`AirbyteTriggerSyncOperator` for guidance. Naturally, the tests would have to
be adjusted as well if you do this.
--
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]