diff --git a/redash/query_runner/athena.py b/redash/query_runner/athena.py index be67870798..eda3c5ef98 100644 --- a/redash/query_runner/athena.py +++ b/redash/query_runner/athena.py @@ -7,7 +7,6 @@ PROXY_URL = os.environ.get('ATHENA_PROXY_URL') - class Athena(BaseQueryRunner): noop_query = 'SELECT 1' @@ -61,10 +60,7 @@ def get_schema(self, get_stats=False): results = json.loads(results) for row in results['rows']: - if row['table_schema'] != 'public': - table_name = '{}.{}'.format(row['table_schema'], row['table_name']) - else: - table_name = row['table_name'] + table_name = '{}.{}'.format(row['table_schema'], row['table_name']) if table_name not in schema: schema[table_name] = {'name': table_name, 'columns': []} diff --git a/redash/query_runner/presto.py b/redash/query_runner/presto.py index 28839a4375..fd8ebc4b9b 100644 --- a/redash/query_runner/presto.py +++ b/redash/query_runner/presto.py @@ -84,11 +84,8 @@ def get_schema(self, get_stats=False): results = json.loads(results) for row in results['rows']: - if row['table_schema'] != 'public': - table_name = '{}.{}'.format(row['table_schema'], row['table_name']) - else: - table_name = row['table_name'] - + table_name = '{}.{}'.format(row['table_schema'], row['table_name']) + if table_name not in schema: schema[table_name] = {'name': table_name, 'columns': []}