From 2c0fbf1124fe242b224b6220f4084c8079956ca5 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Tue, 23 Jul 2024 20:52:47 +0100 Subject: [PATCH] only remove file if uploaded to hf --- cloud_archives/pv/passiv/passiv_monthly.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cloud_archives/pv/passiv/passiv_monthly.py b/cloud_archives/pv/passiv/passiv_monthly.py index d4b0137..f3b9206 100644 --- a/cloud_archives/pv/passiv/passiv_monthly.py +++ b/cloud_archives/pv/passiv/passiv_monthly.py @@ -75,10 +75,10 @@ def get_monthly_passiv_data(start_date: datetime, upload_to_hf: bool = True, ove repo_id="openclimatefix/uk_pv", repo_type="dataset", ) - - # remove local file - logger.info("Removing local file") - os.remove(file) + + # remove local file + logger.info("Removing local file") + os.remove(file) @dg.asset(