Skip to content

fix: bnp importer#103

Merged
skynet2 merged 1 commit intomasterfrom
bnp-importer
Feb 3, 2026
Merged

fix: bnp importer#103
skynet2 merged 1 commit intomasterfrom
bnp-importer

Conversation

@skynet2
Copy link
Member

@skynet2 skynet2 commented Feb 2, 2026

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @skynet2, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the robustness of the transaction import process by introducing more explicit error handling for transactions that fail parsing or have an unknown type. It ensures that such transactions are gracefully captured with their error details, preventing them from causing issues in subsequent processing steps, and includes new tests to verify these improvements.

Highlights

  • Improved Error Handling for Transactions: Transactions encountered during import that have a ParsingError are now immediately captured. Their error details are stored in the Extra field of the request, and they bypass further type-specific processing (income, expense, transfer), ensuring problematic transactions are logged without halting the import flow.
  • Refined Unknown Transaction Type Handling: The logic for handling transactions with unknown types has been updated to consistently record the unknown type identifier in the Extra field, providing clearer diagnostics for unidentifiable transaction types.
  • Comprehensive Unit Tests Added: New unit tests have been introduced to validate the correct behavior of the ToCreateRequests function, specifically covering scenarios with parsing errors, unknown transaction types, and successful processing of valid expense transactions, enhancing code reliability.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the handling of parsing errors in the BNP importer by checking for them at the beginning of the transaction processing loop. This is a good improvement as it simplifies the logic and ensures errored transactions are not processed further. The change also correctly flags unknown transaction types. New tests have been added to cover these changes, which is great. I've found a small opportunity for code cleanup.

Comment on lines 227 to 229
if newTx.Extra == nil {
newTx.Extra = make(map[string]string)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The newTx.Extra field is initialized with make(map[string]string) when newTx is created on line 58, so it will never be nil. This check is redundant and can be removed.

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.48%. Comparing base (544eda6) to head (7213f07).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #103   +/-   ##
=======================================
  Coverage   87.48%   87.48%           
=======================================
  Files          83       83           
  Lines        6832     6834    +2     
=======================================
+ Hits         5977     5979    +2     
  Misses        611      611           
  Partials      244      244           
Flag Coverage Δ
unittests 87.48% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@skynet2 skynet2 merged commit 5abe52b into master Feb 3, 2026
6 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant