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

 ##########
 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:
   Is this 1-indexed or 0-indexed? (I assume 1 since it's Presto, just 
checking.)

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

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

Reply via email to