Skip to content

Commit f3ceb26

Browse files
Make distinction between directory and directory_parent.
1 parent 58b74c5 commit f3ceb26

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
@@ -576,18 +576,18 @@ def write_assets(
576576
options = {}
577577
# TODO: We should treat the directory parameter as an actual directory. (Open-EO/openeo-geopyspark-driver#888)
578578
filename = str(directory)
579-
directory = Path(filename).parent
579+
directory_parent = Path(filename).parent
580580

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

585585
if format_info.format == "JSON":
586586
# TODO: eliminate this legacy format?
587587
log.warning(
588588
f"Exporting vector cube {self} to legacy, non-standard JSON format"
589589
)
590-
return self.to_legacy_save_result().write_assets(directory / "suffix_to_remove")
590+
return self.to_legacy_save_result().write_assets(directory)
591591

592592
gdf = self._as_geopandas_df(flatten_prefix=options.get("flatten_prefix"))
593593
if format_info.format == "Parquet":
@@ -605,7 +605,7 @@ def write_assets(
605605
}}
606606
else:
607607
# Multi-file format
608-
components = list(directory.glob("vectorcube.*"))
608+
components = list(directory_parent.glob("vectorcube.*"))
609609
if options.get("zip_multi_file"):
610610
# TODO: automatically zip shapefile components?
611611
zip_path = path.with_suffix(f".{format_info.extension}.zip")

0 commit comments

Comments
 (0)