nagasrisai opened a new pull request, #64519:
URL: https://github.com/apache/airflow/pull/64519

   While looking into #63930 I noticed that the Salesforce Bulk API result list 
was never inspected for record-level failures. The `simple-salesforce` library 
doesn't raise exceptions for individual record failures — it returns them as 
result dicts with `success=False` and an `errors` list. Up until now those 
would pass through the operator completely silently: the task would show as 
succeeded, and you'd only find out something went wrong by inspecting the XCom 
value or noticing that no data actually changed on the Salesforce side.
   
   There are two changes here:
   
   The operator now calls `_check_result_for_failures()` after every operation. 
If any record came back with `success=False`, it logs a warning per failure 
that includes the status code, human-readable message, and the affected field 
names. This runs unconditionally, so you always get visibility into what went 
wrong even if you don't want the task to fail hard.
   
   There's also a new `raise_on_failures` constructor parameter (defaults to 
`False` so existing pipelines aren't broken). Setting it to `True` causes the 
operator to raise an `AirflowException` after logging all the failures, which 
lets you use standard Airflow retry and alerting behaviour on record-level 
errors.
   
   The result is also materialised into a list before the check so we only 
iterate the iterable once — previously the lazy return value from 
`simple-salesforce` was passed straight through, which would have made it 
impossible to both check for errors and push to XCom in the same call.
   
   Closes #63930


-- 
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]

Reply via email to