Skip to content

Commit

Permalink
Remove unnecessary type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
qwhelan committed May 9, 2024
1 parent a0fbdf0 commit 24695e5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/rp2/plugin/report/jp/tax_report_jp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
from enum import Enum
from itertools import chain
from pathlib import Path
from typing import Any, Dict, List, NamedTuple, Optional, Set, cast
from typing import Any, Dict, List, NamedTuple, Optional, Set

from rp2.abstract_country import AbstractCountry
from rp2.abstract_entry import AbstractEntry
from rp2.abstract_transaction import AbstractTransaction
from rp2.computed_data import ComputedData
from rp2.configuration import MAX_DATE, MIN_DATE
Expand Down Expand Up @@ -169,15 +168,14 @@ def __generate_asset(self, computed_data: ComputedData, output_file: Any) -> Non
in_transaction_set: TransactionSet = computed_data.in_transaction_set
out_transaction_set: TransactionSet = computed_data.out_transaction_set
intra_transaction_set: TransactionSet = computed_data.intra_transaction_set
entry: AbstractEntry
entry: AbstractTransaction
year: int
years_2_transaction_sets: Dict[int, List[AbstractTransaction]] = {}
previous_year_row_offset: int = 0

# Sort all in and out transactions by year, the fee from intra transactions must be reported
for entry in chain(in_transaction_set, out_transaction_set, intra_transaction_set): # type: ignore
transaction: AbstractTransaction = cast(AbstractTransaction, entry)
years_2_transaction_sets.setdefault(transaction.timestamp.year, []).append(entry)
years_2_transaction_sets.setdefault(entry.timestamp.year, []).append(entry)

for year, transaction_set in years_2_transaction_sets.items():
# Sort the transactions by timestamp and generate sheet by year
Expand Down

0 comments on commit 24695e5

Please sign in to comment.