From 62d358bf2f01eaec2e49371de46b8d2464c750c5 Mon Sep 17 00:00:00 2001 From: Alice Fage Date: Mon, 15 Jan 2024 16:29:39 +1300 Subject: [PATCH] fix: appease pylint --- scripts/files/fs.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/files/fs.py b/scripts/files/fs.py index dfed4cb50..3ca0139f6 100644 --- a/scripts/files/fs.py +++ b/scripts/files/fs.py @@ -2,11 +2,11 @@ from concurrent.futures import ThreadPoolExecutor, as_completed from typing import List, Optional +from boto3 import resource from linz_logger import get_log from scripts.aws.aws_helper import is_s3 from scripts.files import fs_local, fs_s3 -from boto3 import client, resource def write(destination: str, source: bytes, content_type: Optional[str] = None) -> str: @@ -83,7 +83,7 @@ def write_all(inputs: List[str], target: str, concurrency: Optional[int] = 4) -> return written_tiffs -def write_sidecars(inputs: List[str], target: str, concurrency: Optional[int] = 4): +def write_sidecars(inputs: List[str], target: str, concurrency: Optional[int] = 4) -> None: """Writes list of files to target destination using multithreading. Args: @@ -100,6 +100,7 @@ def write_sidecars(inputs: List[str], target: str, concurrency: Optional[int] = executor.submit(write, os.path.join(target, f"{os.path.basename(input_)}"), read(input_)): input_ for input_ in inputs } - except resource("s3").meta.client.exceptions.NoSuchKey as nsk: - print(nsk) + for future in as_completed(futuress): + get_log().info("wrote_sidecar_file", path=future.result()) + except resource("s3").meta.client.exceptions.NoSuchKey: pass