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 2019/12/10 19:16:22 UTC

[GitHub] [incubator-superset] khtruong commented on a change in pull request #8799: Update sql validator status

khtruong commented on a change in pull request #8799: Update sql validator status
URL: https://github.com/apache/incubator-superset/pull/8799#discussion_r356227076
 
 

 ##########
 File path: superset/sql_validators/presto_db.py
 ##########
 @@ -107,12 +112,16 @@ def validate_statement(
                     "The pyhive presto client did not report an error message"
                 ) from db_error
             if "errorLocation" not in error_args:
-                raise PrestoSQLValidationError(
-                    "The pyhive presto client did not report an error location"
-                ) from db_error
+                # Pylint is confused about the type of error_args, despite the hints
+                # and checks above.
+                # pylint: disable=invalid-sequence-index
+                message = error_args["message"] + "\n(Error location unknown)"
+                # If we have a message but no error location, return the message and
+                # set the location as the beginning.
+                return SQLValidationAnnotation(
+                    message=message, line_number=1, start_column=1, end_column=1
 
 Review comment:
   1-indexed like you assumed

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

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