psyinfra / onyo

text-based inventory system on top of git
ISC License
3 stars 5 forks source link

Asset dictionary type annotation is overly specific #665

Closed bpoldrack closed 1 month ago

bpoldrack commented 1 month ago

Lots of functions are currently annotated like Dict[str, Union[int, str, float, Path, bool]]. This is a pain and mostly wrong (since most functions would actually work perfectly fine with other types as values or even keys). It's main purpose is to make sure that reading and writing YAML works the way we expect it too. The place to make sure of that is unit tests for dict_to_asset_yaml and asset_yaml_to_dict, though.

Hence: Write those unit tests and reduce the type annotation for everything else to Dict[str, Any] at most.

aqw commented 1 month ago

This has been address by my recent commits and supported by Ben's dot notation PR (#668).

Closing. See also #671