hankehly commented on PR #30981:
URL: https://github.com/apache/airflow/pull/30981#issuecomment-1539217470

   Thanks for your feedback. I agree that showing a warning when a valid 
parameter is entered can reduce usability.
   
   The problem I see with the current implementation is that it **requires** 
the DAG author to enable `render_template_as_native_obj`, which may negatively 
impact other tasks in the same DAG. For really large DAGs, this could mean a 
lot of changes just to implement the `PubSubPublishMessageOperator`. (This has 
actually happened in my company.)
   
   Adding a new parameter for string message data and an option to specify the 
encoding might be a good option for backwards compatibility, but this requires 
more changes to the codebase. I think it may not be necessary if the 
documentation is updated to provide clear instructions on how to encode message 
data before publishing to Pub/Sub. The Pub/Sub Python client documentation also 
makes it clear that [they expect developers to do the encoding 
themselves.](https://cloud.google.com/python/docs/reference/pubsub/latest/google.cloud.pubsub_v1.publisher.client.Client#google_cloud_pubsub_v1_publisher_client_Client_publish)
   
   So I will close this PR and open another one that updates the documentation 
instead. If any Airflow developers see more value in adding string-type message 
data with auto-encoding, please let me know and I will implement the changes.


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