Late import for optional lib pyhive (#7471)

* Late import for optional lib pyhive

* fix
This commit is contained in:
Maxime Beauchemin 2019-05-07 19:16:27 -05:00 committed by GitHub
parent f3d8e8a424
commit e2be0221b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,6 @@ from typing import (
)
from flask import g
from pyhive.exc import DatabaseError
from superset import app, security_manager
from superset.sql_parse import ParsedQuery
@ -77,6 +76,7 @@ class PrestoDBSQLValidator(BaseSQLValidator):
# engine spec's handle_cursor implementation since we don't record
# these EXPLAIN queries done in validation as proper Query objects
# in the superset ORM.
from pyhive.exc import DatabaseError
try:
db_engine_spec.execute(cursor, sql)
polled = cursor.poll()