From c2221fa59685a2704245eed90f1b31b3a252bbed Mon Sep 17 00:00:00 2001 From: NiharDoshi99 <51595473+NiharDoshi99@users.noreply.github.com> Date: Thu, 15 Dec 2022 14:33:25 +0530 Subject: [PATCH] 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 --- ingestion/src/metadata/ingestion/source/database/datalake.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/database/datalake.py b/ingestion/src/metadata/ingestion/source/database/datalake.py index 79b76e58bfe..22336977a6c 100644 --- a/ingestion/src/metadata/ingestion/source/database/datalake.py +++ b/ingestion/src/metadata/ingestion/source/database/datalake.py @@ -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,