Skip to content

Commit b6e8937

Browse files
EmileSonneveldPeter Van Bouwel
authored andcommitted
Make distinction between directory and directory_parent.
1 parent a33ab63 commit b6e8937

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

openeo_driver/datacube.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,18 +578,18 @@ 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?
589589
log.warning(
590590
f"Exporting vector cube {self} to legacy, non-standard JSON format"
591591
)
592-
return self.to_legacy_save_result().write_assets(directory / "suffix_to_remove")
592+
return self.to_legacy_save_result().write_assets(directory)
593593

594594
gdf = self._as_geopandas_df(flatten_prefix=options.get("flatten_prefix"))
595595
if format_info.format == "Parquet":
@@ -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")

0 commit comments

Comments
 (0)