소스 검색

HUE-7738 [sqlalchemy] Return empty functions instead of error

Until supported
Romain 5 년 전
부모
커밋
6dbf75b902
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      desktop/libs/notebook/src/notebook/connectors/sql_alchemy.py

+ 5 - 1
desktop/libs/notebook/src/notebook/connectors/sql_alchemy.py

@@ -341,7 +341,11 @@ class SqlAlchemyApi(Api):
     assist = Assist(inspector, engine, backticks=self.backticks)
     response = {'status': -1}
 
-    if database is None:
+    if operation == 'functions':
+      response['functions'] = []
+    elif operation == 'function':
+      response['function'] = {}
+    elif database is None:
       response['databases'] = [db or 'NULL' for db in assist.get_databases()]
     elif table is None:
       tables_meta = []