Skip to content

Commit 4a858d6

Browse files
committed
fix: mypy fixes
1 parent 59ebff6 commit 4a858d6

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

pystac/extensions/processing.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@
2626
from pystac.summaries import RangeSummary
2727
from pystac.utils import StringEnum, datetime_to_str, map_opt, str_to_datetime
2828

29-
T = TypeVar("T", pystac.Item, pystac.Asset, item_assets.AssetDefinition)
29+
T = TypeVar(
30+
"T",
31+
pystac.Item,
32+
pystac.Asset,
33+
item_assets.AssetDefinition,
34+
pystac.ItemAssetDefinition,
35+
)
3036

3137
SCHEMA_URI: str = "https://stac-extensions.github.io/processing/v1.2.0/schema.json"
3238
SCHEMA_URIS: list[str] = [
@@ -298,7 +304,7 @@ def get_schema_uri(cls) -> str:
298304
def ext(cls, obj: T, add_if_missing: bool = False) -> ProcessingExtension[T]:
299305
if isinstance(obj, pystac.Item):
300306
cls.ensure_has_extension(obj, add_if_missing)
301-
return cast(ProcessingExtension, ItemProcessingExtension(obj))
307+
return cast(ProcessingExtension[pystac.Item], ItemProcessingExtension(obj))
302308
else:
303309
raise pystac.ExtensionTypeError(cls._ext_error_message(obj))
304310

@@ -432,15 +438,15 @@ def version(self, v: RangeSummary[str] | None) -> None:
432438
self._set_summary(VERSION_PROP, v)
433439

434440
@property
435-
def software(self) -> RangeSummary[dict[str, str]] | None:
441+
def software(self) -> list[dict[str, str]] | None:
436442
"""Get or sets the summary of :attr:`ProcessingExtension.software` values
437443
for this Collection.
438444
"""
439445

440-
return self.summaries.get_range(SOFTWARE_PROP)
446+
return self.summaries.get_list(SOFTWARE_PROP)
441447

442448
@software.setter
443-
def software(self, v: RangeSummary[dict[str, str]] | None) -> None:
449+
def software(self, v: list[dict[str, str]] | None) -> None:
444450
self._set_summary(SOFTWARE_PROP, v)
445451

446452

0 commit comments

Comments
 (0)