feluelle commented on a change in pull request #7451: [AIRFLOW-6830] Add 
Subject/MessageAttributes to SNS hook and operator
URL: https://github.com/apache/airflow/pull/7451#discussion_r380593699
 
 

 ##########
 File path: airflow/providers/amazon/aws/hooks/sns.py
 ##########
 @@ -24,6 +24,20 @@
 from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
 
 
+def _get_message_attribute(o):
+    if isinstance(o, bytes):
+        return {'DataType': 'Binary', 'BinaryValue': o}
+    elif isinstance(o, str):
+        return {'DataType': 'String', 'StringValue': o}
+    elif isinstance(o, (int, float)):
+        return {'DataType': 'Number', 'StringValue': str(o)}
+    elif hasattr(o, '__iter__'):
 
 Review comment:
   ```suggestion
       if hasattr(o, '__iter__'):
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to