You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/01/10 23:33:05 UTC

[GitHub] [superset] betodealmeida commented on a change in pull request #17749: feat(alerts): Select tabs to send backend

betodealmeida commented on a change in pull request #17749:
URL: https://github.com/apache/superset/pull/17749#discussion_r781650743



##########
File path: superset/reports/notifications/base.py
##########
@@ -27,7 +27,7 @@
 class NotificationContent:
     name: str
     csv: Optional[bytes] = None  # bytes for csv file
-    screenshot: Optional[bytes] = None  # bytes for the screenshot
+    screenshots: Optional[List[bytes]] = None  # bytes for the screenshot

Review comment:
       Nit:
   
   ```suggestion
       screenshots: Optional[List[bytes]] = None  # bytes for the screenshots
   ```

##########
File path: superset/reports/notifications/email.py
##########
@@ -89,11 +94,15 @@ def _get_content(self) -> EmailContent:
             html_table = ""
 
         call_to_action = __("Explore in Superset")
-        img_tag = (
-            f'<img width="1000px" src="cid:{msgid}">'
-            if self._content.screenshot
-            else ""
-        )
+        img_tag = ""
+        for msgid, _ in images.items():

Review comment:
       Nit:
   
   ```suggestion
           for msgid in images.keys():
   ```
   
   (Or just `images` instead of `images.keys()`, though I think explicit is better.)

##########
File path: superset/reports/notifications/email.py
##########
@@ -89,11 +94,15 @@ def _get_content(self) -> EmailContent:
             html_table = ""
 
         call_to_action = __("Explore in Superset")
-        img_tag = (
-            f'<img width="1000px" src="cid:{msgid}">'
-            if self._content.screenshot
-            else ""
-        )
+        img_tag = ""
+        for msgid, _ in images.items():
+            img_tag = img_tag + (

Review comment:
       Nit, it's more idiomatic to do this by `join`ing a `List[str]`:
   
   ```python
   img_tags = []
   for msgid in images.keys():
       img_tags.append('<div ...>')
   img_tag = ''.join(img_tags)
   ```




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org