From d1dc18cfda98edc53f4d93cbdf6d54a8a9415f87 Mon Sep 17 00:00:00 2001 From: Emile Sonneveld Date: Mon, 1 Apr 2024 21:55:58 +0200 Subject: [PATCH] Log paths in GeopySparkRandomForestModel. https://github.com/Open-EO/openeo-geopyspark-driver/issues/562 --- openeogeotrellis/ml/GeopySparkRandomForestModel.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openeogeotrellis/ml/GeopySparkRandomForestModel.py b/openeogeotrellis/ml/GeopySparkRandomForestModel.py index 35f19d123..ac82e6677 100644 --- a/openeogeotrellis/ml/GeopySparkRandomForestModel.py +++ b/openeogeotrellis/ml/GeopySparkRandomForestModel.py @@ -1,3 +1,5 @@ +import logging + import shutil import typing import uuid @@ -11,6 +13,7 @@ from openeo_driver.utils import generate_unique_id +logger = logging.getLogger(__name__) class GeopySparkRandomForestModel(DriverMlModel): @@ -92,6 +95,7 @@ def write_assets(self, directory: Union[str, Path]) -> Dict[str, StacAsset]: :return: STAC assets dictionary: https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#assets """ + logging.info(f"write_assets({directory=})") # For debugging S3 paths directory = Path(directory) if not directory.is_dir(): directory = Path(directory).parent @@ -100,6 +104,7 @@ def write_assets(self, directory: Union[str, Path]) -> Dict[str, StacAsset]: shutil.make_archive(base_name=str(model_path), format='gztar', root_dir=directory) shutil.rmtree(model_path) model_path = Path(str(model_path) + '.tar.gz') + logging.info(f"{model_path=}") # For debugging S3 paths return {model_path.name: {"href": str(model_path)}} def get_model(self):