Skip to content

Commit

Permalink
Better error message. Avoid old 'types import NoneType'.
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileSonneveld committed Sep 23, 2024
1 parent b4d93bc commit 41293e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion stacbuilder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ def is_known_asset_type(metadata: AssetMetadata) -> bool:

known_assets = [a for a in assets if is_known_asset_type(a)]
if not known_assets:
error_msg = "None of the assets in 'assets' is a known item type, not defined in collection configuration."
error_msg = ("None of the assets is defined in collection configuration. " +
f"{[a.asset_type for a in assets]} not found in {list(self.item_assets_configs.keys())}")

_logger.warning(error_msg)
return None

Expand Down
3 changes: 2 additions & 1 deletion stacbuilder/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import datetime as dt
import json
from pathlib import Path
from types import NoneType
# from types import NoneType
from typing import Any, Dict, List, Optional, Tuple, Union


Expand All @@ -34,6 +34,7 @@


BoundingBoxList = List[Union[float, int]]
NoneType = type(None)


@dataclass
Expand Down

0 comments on commit 41293e9

Please sign in to comment.