Bug 444741 - CSV importer: account name auto detection generates too many false-positives
Summary: CSV importer: account name auto detection generates too many false-positives
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (other bugs)
Version First Reported In: 5.1.2
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-31 20:26 UTC by Dawid Wróbel
Modified: 2024-12-19 10:04 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dawid Wróbel 2021-10-31 20:26:09 UTC
SUMMARY
With account name auto detection, CSV importer will automatically attempt to match the imported CSV against existing accounts. However, in case the CSV header only actually contains column names, this may lead to false positives. For example, considering a CSV file containing following header:

"Type,Product,Started Date,Completed Date,Description,Amount,Fee,Currency,State,Balance"

the importer will match against an "Art" account, having found a match for it in "Started". 

The solution is to make the autodetection configurable per profile, not globally, which will allow to take advantage of its heuristics only when it actually makes sense.
Comment 1 Bug Janitor Service 2021-10-31 20:31:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/office/kmymoney/-/merge_requests/127
Comment 2 Bug Janitor Service 2021-10-31 20:39:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/office/kmymoney/-/merge_requests/128
Comment 3 Dawid Wróbel 2022-07-10 17:17:13 UTC
Git commit 9ec90abbc80a92bf8a7673bedac73219c10b7902 by Dawid Wróbel.
Committed on 10/07/2022 at 09:47.
Pushed by wrobelda into branch '5.1'.

[CSV] Configure account autodetection per profile

CSV importer had a global option enabling account name autodetection
based on the header contents. This, however, should only really be
enabled if the CSV file contains actual account name, and therefore
configurable *per profile*.

Also: run clang-format against touched source files.

M  +31   -29   kmymoney/plugins/csv/import/core/csvimportercore.cpp
M  +120  -65   kmymoney/plugins/csv/import/core/csvimportercore.h
M  +39   -24   kmymoney/plugins/csv/import/core/tests/csvimportercore-test.cpp
M  +4    -0    kmymoney/plugins/csv/import/csvwizard.cpp
M  +0    -6    kmymoney/plugins/csv/import/pluginsettings.kcfg
M  +44   -1    kmymoney/plugins/csv/import/rowswizardpage.ui
M  +8    -1    kmymoney/settings/kmymoney.upd

https://invent.kde.org/office/kmymoney/commit/9ec90abbc80a92bf8a7673bedac73219c10b7902
Comment 4 Dawid Wróbel 2022-07-10 17:17:26 UTC
Git commit 1ebd8c704deb2af890aa54c60411f6e627bd8a4b by Dawid Wróbel.
Committed on 10/07/2022 at 09:42.
Pushed by wrobelda into branch 'master'.

[CSV] Configure account autodetection per profile

CSV importer had a global option enabling account name autodetection
based on the header contents. This, however, should only really be
enabled if the CSV file contains actual account name, and therefore
configurable *per profile*.

Also: run clang-format against touched source files.

M  +31   -29   kmymoney/plugins/csv/import/core/csvimportercore.cpp
M  +120  -65   kmymoney/plugins/csv/import/core/csvimportercore.h
M  +39   -24   kmymoney/plugins/csv/import/core/tests/csvimportercore-test.cpp
M  +4    -0    kmymoney/plugins/csv/import/csvwizard.cpp
M  +0    -6    kmymoney/plugins/csv/import/pluginsettings.kcfg
M  +44   -1    kmymoney/plugins/csv/import/rowswizardpage.ui
M  +7    -1    kmymoney/settings/kmymoney.upd

https://invent.kde.org/office/kmymoney/commit/1ebd8c704deb2af890aa54c60411f6e627bd8a4b