From 7ed46d98fa201cd99451d94e2a21b272f39b9e79 Mon Sep 17 00:00:00 2001 From: Taran <97586318+Tarraann@users.noreply.github.com> Date: Wed, 19 Jul 2023 14:36:47 +0530 Subject: [PATCH] csv file fix (#810) --- superagi/resource_manager/file_manager.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/superagi/resource_manager/file_manager.py b/superagi/resource_manager/file_manager.py index c93c64c6d..0ccc30950 100644 --- a/superagi/resource_manager/file_manager.py +++ b/superagi/resource_manager/file_manager.py @@ -86,10 +86,9 @@ def write_csv_file(self, file_name: str, csv_data): final_path = ResourceHelper.get_resource_path(file_name) try: - with open(final_path, mode="w") as file: + with open(final_path, mode="w", newline="") as file: writer = csv.writer(file, lineterminator="\n") - for row in csv_data: - writer.writerows(row) + writer.writerows(csv_data) self.write_to_s3(file_name, final_path) logger.info(f"{file_name} - File written successfully") return f"{file_name} - File written successfully"