superset-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-superset] john-bodley commented on a change in pull request #9753: feat: convert backend chart errors to the new error type
Date Thu, 07 May 2020 02:10:04 GMT

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:
users@infra.apache.org



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


Mime
View raw message