You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/10/29 18:32:42 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #5694: [AIRFLOW-5082] add subject in aws sns hook

mik-laj commented on a change in pull request #5694: [AIRFLOW-5082] add subject in aws sns hook
URL: https://github.com/apache/airflow/pull/5694#discussion_r340255704
 
 

 ##########
 File path: airflow/contrib/hooks/aws_sns_hook.py
 ##########
 @@ -53,8 +55,16 @@ def publish_to_target(self, target_arn, message):
             'default': message
         }
 
+        if subject is None:
 
 Review comment:
   ```
       def publish_to_target(self, target_arn, message, subject=None):
           """
           Publish a message to a topic or an endpoint.
           :param target_arn: either a TopicArn or an EndpointArn
           :type target_arn: str
           :param message: the default message you want to send
           :param message: str
           :param subject: subject of message
           :type subject: str
           """
   
           conn = self.get_conn()
   
           messages = {
               'default': message
           }
   
           return conn.publish(
               TargetArn=target_arn,
               Message=json.dumps(messages),
               MessageStructure='json',
               Subject=subject
           )
   ```
   Will this code work properly?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services