From 5e061da94018843c25f8826b9c348981bf9a898d Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Fri, 24 Apr 2020 15:36:02 -0400 Subject: [PATCH] reports: Fix return type of RelatedPostings.group_by_meta. --- conservancy_beancount/reports/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conservancy_beancount/reports/core.py b/conservancy_beancount/reports/core.py index 25a872b..2ef93c8 100644 --- a/conservancy_beancount/reports/core.py +++ b/conservancy_beancount/reports/core.py @@ -106,7 +106,7 @@ class RelatedPostings(Sequence[data.Posting]): postings: Iterable[data.Posting], key: MetaKey, default: Optional[MetaValue]=None, - ) -> Mapping[MetaKey, 'RelatedPostings']: + ) -> Mapping[Optional[MetaValue], 'RelatedPostings']: """Relate postings by metadata value This method takes an iterable of postings and returns a mapping. @@ -114,7 +114,7 @@ class RelatedPostings(Sequence[data.Posting]): The values are RelatedPostings instances that contain all the postings that had that same metadata value. """ - retval: DefaultDict[MetaKey, 'RelatedPostings'] = collections.defaultdict(cls) + retval: DefaultDict[Optional[MetaValue], 'RelatedPostings'] = collections.defaultdict(cls) for post in postings: retval[post.meta.get(key, default)].add(post) retval.default_factory = None