Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions transfers/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
from typing import Callable, Iterable, Any
from typing import Callable, Iterable, Any, Optional

from services.gcs_helper import get_storage_bucket
from transfers.logger import logger
Expand Down Expand Up @@ -84,13 +84,14 @@ def run(
return result, artifact


def upload_profile_artifacts(artifacts: Iterable[ProfileArtifact]) -> None:
def upload_profile_artifacts(artifacts: Optional[Iterable[ProfileArtifact]]) -> None:
"""Upload generated profiling artifacts to the configured storage bucket."""

artifacts = list(artifacts)
if not artifacts:
logger.info("No profiling artifacts to upload")
return

artifacts = list(artifacts)

bucket = get_storage_bucket()
for artifact in artifacts:
for path in (artifact.stats_path, artifact.report_path):
Expand Down
Loading