You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2021/11/22 19:41:05 UTC

[superset] 07/12: fix(sqllab): SqlJsonExecutionContext.query null pointer (#16997)

This is an automated email from the ASF dual-hosted git repository.

elizabeth pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 2eaf5c854edd06d2deb4bb106324c5599fd99452
Author: serenajiang <se...@airbnb.com>
AuthorDate: Wed Oct 6 15:40:54 2021 -0700

    fix(sqllab): SqlJsonExecutionContext.query null pointer (#16997)
    
    (cherry picked from commit cde4cdcd0cb23f3b4a34172231ae4318456fda54)
---
 superset/sqllab/sqllab_execution_context.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/superset/sqllab/sqllab_execution_context.py b/superset/sqllab/sqllab_execution_context.py
index 52ba2e7..b44ec61 100644
--- a/superset/sqllab/sqllab_execution_context.py
+++ b/superset/sqllab/sqllab_execution_context.py
@@ -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: