Get column names and types from a query

def get_column_names(context, query):
        """Get column names and types from a query"""
        table_info = context.sql_client.send(query)
        if 'fields' in table_info:
            return table_info['fields']

        return None