Skip to content

Commit

Permalink
fixup! Separate filename and s3key
Browse files Browse the repository at this point in the history
  • Loading branch information
tukiains committed Nov 25, 2024
1 parent d3ce691 commit 0f6017a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/processing/processor.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand All @@ -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)
Expand All @@ -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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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", [])
Expand All @@ -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,
Expand All @@ -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"
Expand Down

0 comments on commit 0f6017a

Please sign in to comment.