In Cloud Composer, you want to prevent a task from retrying if it fails due to a specific error (e.g., File Not Found). How can you configure this?
Trap 1: Set 'retries: 0' in the task operator.
This disables retries for all errors, not just specific ones.
Trap 2: Use the 'on_failure_callback' to cancel retries.
The callback occurs after the failure, but retries are already scheduled.
Trap 3: Configure 'retry_delay' to be infinite.
Infinite delays are not a standard configuration.
- A
Set 'retries: 0' in the task operator.
Why wrong: This disables retries for all errors, not just specific ones.
- B
Use the 'on_failure_callback' to cancel retries.
Why wrong: The callback occurs after the failure, but retries are already scheduled.
- C
Configure 'retry_delay' to be infinite.
Why wrong: Infinite delays are not a standard configuration.
- D
Raise 'AirflowSkipException' in your task code.
Raising a skip exception prevents the task from being marked as 'failed', stopping retries.