Skip to content

Commit 7d83483

Browse files
Merge pull request #343 from Open-EO/suffix_to_remove
Suffix to remove
2 parents c9982e1 + f3ceb26 commit 7d83483

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

openeo_driver/datacube.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,11 +578,11 @@ def write_assets(
578578
options = {}
579579
# TODO: We should treat the directory parameter as an actual directory. (Open-EO/openeo-geopyspark-driver#888)
580580
filename = str(directory)
581-
directory = Path(filename).parent
581+
directory_parent = Path(filename).parent
582582

583583
format_info = IOFORMATS.get(format)
584584
# TODO: check if format can be used for vector data?
585-
path = directory / f"vectorcube.{format_info.extension}"
585+
path = directory_parent / f"vectorcube.{format_info.extension}"
586586

587587
if format_info.format == "JSON":
588588
# TODO: eliminate this legacy format?
@@ -607,7 +607,7 @@ def write_assets(
607607
}}
608608
else:
609609
# Multi-file format
610-
components = list(directory.glob("vectorcube.*"))
610+
components = list(directory_parent.glob("vectorcube.*"))
611611
if options.get("zip_multi_file"):
612612
# TODO: automatically zip shapefile components?
613613
zip_path = path.with_suffix(f".{format_info.extension}.zip")

openeo_driver/save_result.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ def create_flask_response(self) -> Response:
205205
asset = assets.popitem()[1]
206206
path = Path(asset["href"])
207207
mimetype = asset.get("type")
208+
assert path.relative_to(tmp_dir)
208209
return send_from_directory(path.parent, path.name, mimetype=mimetype)
209210

210211

0 commit comments

Comments
 (0)