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

   `CloudMonitoringListAlertPoliciesOperator` and 
`CloudMonitoringListNotificationChannelsOperator` accept a `format_` parameter 
and forward it to the hook, but then unconditionally call 
`AlertPolicy.to_dict()` / `NotificationChannel.to_dict()` on the result. Since 
`CloudMonitoringHook.list_alert_policies()` / `list_notification_channels()` 
already return dicts for `format_="dict"` and JSON strings for 
`format_="json"`, that conversion raised `TypeError` for anything other than 
`format_=None`.
   
   Both operators now return the hook result unchanged when `format_` is set 
and only convert protobuf objects to dicts (for XCom serialization) when 
`format_` is `None`. The deprecated `Stackdriver*` operators inherit the fix. 
The `format_` docstrings are updated to describe the actual returned types, and 
parametrized tests cover the `dict` and `json` cases for both operators.
   
   closes: #73431
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Devin following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


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