Skip to content

Commit 4ab14a3

Browse files
feat(#147): accommodate nested relative paths in existing index
1 parent 6c1f059 commit 4ab14a3

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/stac-index/src/stac_index/indexer/creator/creator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ async def _load_existing_index(self: Self, manifest_json_uri: str) -> IndexManif
488488
raise ValueError(f"{table_name} table not present in index_manifest")
489489
relative_path = index_manifest.tables[table_name].relative_path
490490
tmp_file_path = path.join(tmp_dir_path, relative_path)
491+
makedirs(path.dirname(tmp_file_path), exist_ok=True)
491492
await source_reader.get_uri_to_file(
492493
source_reader.path_separator().join(
493494
manifest_json_uri.split(source_reader.path_separator())[:-1]

packages/stac-index/src/stac_index/io/readers/s3/s3_source_reader.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ async def get_uri_as_string(self: Self, uri: str) -> str:
8888
async def get_uri_to_file(self: Self, uri, file_path: str):
8989
chunk_size = 1000000
9090
source = await self._get_uri_as_bytes(uri)
91+
_logger.debug(f"write bytes to {file_path}")
9192
with open(file_path, "wb") as f:
9293
offset = 0
9394
while offset < len(source):

0 commit comments

Comments
 (0)