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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to