From 0f6017add4d8b3f3a989e4084facbe276d79591e Mon Sep 17 00:00:00 2001 From: Simo Tukiainen Date: Mon, 25 Nov 2024 15:54:41 +0200 Subject: [PATCH] fixup! Separate filename and s3key --- src/processing/processor.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/processing/processor.py b/src/processing/processor.py index 31f5c201..4f1b3e88 100644 --- a/src/processing/processor.py +++ b/src/processing/processor.py @@ -1,7 +1,7 @@ import datetime import logging import re -import uuid +import uuid as std_uuid from dataclasses import dataclass from pathlib import Path from typing import Literal @@ -236,7 +236,7 @@ def download_adjoining_daily_files( self, params: InstrumentParams, directory: Path, - ) -> tuple[list[Path], list[uuid.UUID]]: + ) -> tuple[list[Path], list[std_uuid.UUID]]: """Download raw files from today and tomorrow to handle non-UTC timestamps.""" next_day = params.date + datetime.timedelta(days=1) payload = self._get_payload( @@ -298,7 +298,7 @@ def upload_file( self, params: ProcessParams, full_path: Path, - uuid: uuid.UUID, + uuid: std_uuid.UUID, filename: str, volatile: bool, patch: bool, @@ -321,7 +321,7 @@ def upload_file( payload["patch"] = patch self.md_api.put("files", s3key, payload) - def update_statuses(self, raw_uuids: list[uuid.UUID], status: str): + def update_statuses(self, raw_uuids: list[std_uuid.UUID], status: str): for raw_uuid in raw_uuids: payload = {"uuid": str(raw_uuid), "status": status} self.md_api.post("upload-metadata", payload) @@ -330,7 +330,7 @@ def create_and_upload_images( self, full_path: Path, product: str, - product_uuid: uuid.UUID, + product_uuid: std_uuid.UUID, product_s3key: str, directory: Path, legacy: bool = False, @@ -376,7 +376,7 @@ def create_and_upload_l3_images( full_path: Path, product: str, model_id: str, - product_uuid: uuid.UUID, + product_uuid: std_uuid.UUID, product_s3key: str, directory: Path, ) -> None: @@ -427,7 +427,7 @@ def create_and_upload_l3_images( self._delete_obsolete_images(product_uuid, product, valid_images) def _delete_obsolete_images( - self, product_uuid: uuid.UUID, product: str, valid_images: list[str] + self, product_uuid: std_uuid.UUID, product: str, valid_images: list[str] ): url = f"api/visualizations/{product_uuid}" image_metadata = self.md_api.get(url).get("visualizations", []) @@ -440,7 +440,7 @@ def _upload_img( self, img_path: Path, product_s3key: str, - product_uuid: uuid.UUID, + product_uuid: std_uuid.UUID, product: str, field: str, dimensions: Dimensions, @@ -456,7 +456,7 @@ def _upload_img( } def upload_quality_report( - self, full_path: Path, uuid: uuid.UUID, product: str | None = None + self, full_path: Path, uuid: std_uuid.UUID, product: str | None = None ) -> str: try: # is_dev = self.config.get("PID_SERVICE_TEST_ENV", "").lower() == "true"