fix(sqllab): SqlJsonExecutionContext.query null pointer (#16997)

This commit is contained in:
serenajiang 2021-10-06 15:40:54 -07:00 committed by GitHub
parent 90cfa7fb22
commit cde4cdcd0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -180,7 +180,7 @@ class SqlJsonExecutionContext: # pylint: disable=too-many-instance-attributes
def get_query_details(self) -> str:
try:
if self.query:
if hasattr(self, "query"):
if self.query.id:
return "query '{}' - '{}'".format(self.query.id, self.query.sql)
except DetachedInstanceError: