From 6cd06700da70bfc09c09ff07e5477a9dfb5603b3 Mon Sep 17 00:00:00 2001 From: devsjc <47188100+devsjc@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:33:46 +0100 Subject: [PATCH] fix(ceda_global): Use constants for folders --- local_archives/nwp/ceda/ceda_global.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/local_archives/nwp/ceda/ceda_global.py b/local_archives/nwp/ceda/ceda_global.py index ff97383..7174d2e 100644 --- a/local_archives/nwp/ceda/ceda_global.py +++ b/local_archives/nwp/ceda/ceda_global.py @@ -4,12 +4,16 @@ import datetime as dt from dagster_docker import PipesDockerClient +from constants import LOCATIONS_BY_ENVIRONMENT + +env = os.getenv("ENVIRONMENT", "local") +ZARR_FOLDER = LOCATIONS_BY_ENVIRONMENT[env].NWP_ZARR_FOLDER @dg.asset( name="zarr_archive", key_prefix=["nwp", "ceda", "global"], metadata={ - "archive_folder": dg.MetadataValue.text("/mnt/storage_b/nwp/ceda/global"), + "archive_folder": dg.MetadataValue.text(f"{ZARR_FOLDER}/nwp/ceda/global"), "area": dg.MetadataValue.text("global"), "source": dg.MetadataValue.text("ceda"), }, @@ -42,7 +46,7 @@ def ceda_global( "CEDA_FTP_PASSWORD": os.environ["CEDA_FTP_PASSWORD"], }, container_kwargs={ - "volumes": ["/mnt/storage_b/nwp/ceda/global:/work"], + "volumes": [f"{ZARR_FOLDER}/nwp/ceda/global:/work"], }, context=context, ).get_results()