You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/01/24 02:34:05 UTC

[GitHub] [incubator-superset] john-bodley commented on a change in pull request #9012: [SQL Lab] Add function names to autocomplete

john-bodley commented on a change in pull request #9012: [SQL Lab] Add function names to autocomplete
URL: https://github.com/apache/incubator-superset/pull/9012#discussion_r370451868
 
 

 ##########
 File path: superset/db_engine_specs/hive.py
 ##########
 @@ -422,3 +422,15 @@ def execute(  # type: ignore
     ):  # pylint: disable=arguments-differ
         kwargs = {"async": async_}
         cursor.execute(query, **kwargs)
+
+    @classmethod
+    def get_function_names(cls, database: "Database") -> List[str]:
+        """
+        Get a list of function names that are able to be called on the database.
+        Used for SQL Lab autocomplete.
+
+        :param database: The database to get functions for
+        :return: A list of function names useable in the database
+        """
+        df = database.get_df("SHOW FUNCTIONS")
 
 Review comment:
   Can we remove the interim `df` variable, i.e., 
   
   ```
   return database.get_df("SHOW FUNCTIONS")["tab_name"].tolist()
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org