Fix: Datalake s3 get list of files (#9294)

* Fix: changed func to get list of files

* Fix: minor change

* Fix: minor change

* Fix: adding exception
This commit is contained in:
NiharDoshi99 2022-12-15 14:33:25 +05:30 committed by GitHub
parent 8fe3b09d21
commit c2221fa596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,10 +233,10 @@ class DatalakeSource(DatabaseServiceSource): # pylint: disable=too-many-public-
try:
paginator = self.client.get_paginator("list_objects_v2")
for page in paginator.paginate(**kwargs):
yield from page["Contents"]
yield from page.get("Contents", [])
except Exception as exc:
logger.debug(traceback.format_exc())
logger.warning(f"Unexpected exception to yield s3 object [{page}]: {exc}")
logger.warning(f"Unexpected exception to yield s3 object: {exc}")
def get_tables_name_and_type( # pylint: disable=too-many-branches
self,