Skip to content

Commit d9ee425

Browse files
committed
fix: id+key reporting in cli
1 parent 47cec93 commit d9ee425

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1717
- Expand the list of exceptions on which we should retry for HTTP ([#195](https://github.com/stac-utils/stac-asset/pull/195))
1818
- `SkipAssetDownload` docstring ([#199](https://github.com/stac-utils/stac-asset/pull/199))
1919
- Fast failing when we hit `max_concurrent_downloads` ([#204](https://github.com/stac-utils/stac-asset/pull/204))
20+
- Id+key reporting in CLI ([#206](https://github.com/stac-utils/stac-asset/pull/206))
2021

2122
## [0.4.1] - 2024-07-17
2223

src/stac_asset/_cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ async def report_progress(messages: Optional[MessageQueue]) -> None:
339339
unit_divisor=1024,
340340
)
341341
sizes = dict()
342-
owners = dict()
342+
ids = dict()
343343
assets = 0
344344
done = 0
345345
errors = 0
@@ -352,7 +352,9 @@ async def report_progress(messages: Optional[MessageQueue]) -> None:
352352
if isinstance(message, StartAssetDownload):
353353
assets += 1
354354
if message.owner_id:
355-
owners[message.key] = message.owner_id
355+
ids[message.href] = f"{message.owner_id}[{message.key}]"
356+
else:
357+
ids[message.href] = f"[{message.key}]"
356358
progress_bar.set_description(f"{done}/{assets}")
357359
elif isinstance(message, OpenUrl):
358360
if message.size:
@@ -376,10 +378,8 @@ async def report_progress(messages: Optional[MessageQueue]) -> None:
376378
progress_bar.update(n)
377379
progress_bar.set_postfix_str(f"{errors} errors, {skips} skips")
378380
progress_bar.set_description_str(f"{done}/{assets}")
379-
if message.key in owners:
380-
name = f"{owners[message.key]}[{message.key}]"
381-
else:
382-
name = f"[{message.key}]"
381+
if message.href in ids:
382+
name = ids[message.href]
383383
progress_bar.write(
384384
f"ERROR: {name} - {type(message.error).__name__}: {message.error}",
385385
file=sys.stderr,

0 commit comments

Comments
 (0)