john-bodley commented on a change in pull request #9753:
URL: 
https://github.com/apache/incubator-superset/pull/9753#discussion_r421197728



##########
File path: superset/viz.py
##########
@@ -460,8 +462,19 @@ def get_df_payload(self, query_obj=None, **kwargs):
                     is_loaded = True
             except Exception as ex:
                 logger.exception(ex)
-                if not self.error_message:
-                    self.error_message = "{}".format(ex)
+
+                error = dataclasses.asdict(
+                    SupersetError(
+                        message="{}".format(ex),
+                        level=ErrorLevel.ERROR,
+                        type=SupersetErrorType.VIZ_GET_DF_ERROR,
+                        extra={},
+                    )
+                )
+                if not self.errors:

Review comment:
       @etr2460 apologies if I'm misreading the logic but isn't `self.errors` 
going to be   a list by default and thus rather than:
   
   ```python
   if not self.errors:
       self.errors = [error]
   else:
       self.errors.append(error)
   ```
   
   this could be:
   
   ```python
   self.errors.append(error)
   ```




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to