-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Athena] Fix: missing databases (apply pagination) #2503
Conversation
redash/query_runner/athena.py
Outdated
database_paginator = client.get_paginator('get_databases') | ||
table_paginator = client.get_paginator('get_tables') | ||
databases = (database for databases in database_paginator.paginate() | ||
for database in databases['DatabaseList']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something in these 2 lines doesn't look right. are you sure this is what you wanted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to paginate over both databases and tables.
A database paginator returns a list of lists, in the l#130 I flatten it inside a generator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would suffice to just indent the double for-loops differently to make it more clear?
redash/query_runner/athena.py
Outdated
database_paginator = client.get_paginator('get_databases') | ||
table_paginator = client.get_paginator('get_tables') | ||
databases = (database for databases in database_paginator.paginate() | ||
for database in databases['DatabaseList']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making the change into two for-loops. But don't we need to remove lines 130-131 now?
Thanks! |
Closes #2500.