Skip to content

Commit

Permalink
Merge 02cd249 into e2c601f
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Dec 6, 2020
2 parents e2c601f + 02cd249 commit ed5331a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions beancount_import/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,10 @@ def combine_transactions_using_match_set(
txns: Tuple[Transaction, Transaction], is_cleared: IsClearedFunction,
match_set: PostingMatchSet) -> Transaction:
"""Combines two transactions.
Metadata is merged (it is assumed that the metadata keys, other than
ignorable ones, are disjoint).
If a cleared transaction is matched with multiple transactions (guaranteed
to be uncleared), the result is a single merged transaction.
Expand Down Expand Up @@ -720,8 +720,7 @@ def get_aggregate_posting_candidates(
continue
if is_cleared(posting):
continue
possible_sets.setdefault((posting.account, posting.units.currency,
posting.units.number > ZERO),
possible_sets.setdefault((posting.account, posting.units.currency),
[]).append(posting)
results = []
max_subset_size = 4
Expand All @@ -737,7 +736,7 @@ def add_subset(account, currency, subset):
meta=None)
results.append((aggregate_posting, tuple(subset)))

for (account, currency, _), posting_list in possible_sets.items():
for (account, currency), posting_list in possible_sets.items():
if len(posting_list) == 1:
continue
if len(posting_list) > max_subset_size:
Expand Down

0 comments on commit ed5331a

Please sign in to comment.