Skip to content

Commit

Permalink
fix duplicate timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelsoup42 committed Oct 2, 2023
1 parent 64e2069 commit 8098606
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/cardano_account_pandas_dumper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,20 @@ def main():
with_rewards=not args.no_rewards,
detail_level=args.detail_level,
)
transactions = (
pd.Series(
{reporter.extract_timestamp(t): t for t in data_from_api.transactions}
| (
{}
if args.no_rewards
else {
reporter.extract_timestamp(t): t
for t in [
reporter.reward_transaction(r) for r in data_from_api.rewards
]
}
)
transactions = pd.concat(
[data_from_api.transactions]
+ (
[]
if args.no_rewards
else [
pd.Series(
[reporter.reward_transaction(r) for r in data_from_api.rewards]
)
]
)
.rename("transactions")
.sort_index()
)
transactions.index = [reporter.extract_timestamp(t) for t in transactions]
transactions.sort_index(inplace=True)
if args.csv_output:
try:
reporter.make_transaction_frame(
Expand Down

0 comments on commit 8098606

Please sign in to comment.