From 0f65fbac31ab8bc21558c10a1da905b21cb1039b Mon Sep 17 00:00:00 2001 From: Blake Imsland Date: Thu, 8 Feb 2018 13:02:53 -0800 Subject: [PATCH] Use a paginator when iterating over glue tables Without this you only get the first 100 tables in the glue database --- redash/query_runner/athena.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/redash/query_runner/athena.py b/redash/query_runner/athena.py index 58d0e70315..d79f731a1e 100644 --- a/redash/query_runner/athena.py +++ b/redash/query_runner/athena.py @@ -136,9 +136,11 @@ def __get_schema_from_glue(self): region_name=self.configuration['region'] ) schema = {} + paginator = client.get_paginator('get_tables') for database in client.get_databases()['DatabaseList']: - for table in client.get_tables(DatabaseName=database['Name'])['TableList']: + iterator = paginator.paginate(DatabaseName=database['Name']) + for table in iterator.search('TableList[]'): table_name = '%s.%s' % (database['Name'], table['Name']) if table_name not in schema: column = [columns['Name'] for columns in table['StorageDescriptor']['Columns']]