This repository has been archived by the owner on Feb 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
invalid column name 'id' as key #51
Comments
Thanks for the bug report. Can you provide some fake example data that it
fails for?
…On Fri, 7 Dec 2018 at 10:14, wyhwow ***@***.***> wrote:
In the API :diff_files example ,it can work sucessful with column 'name'
but failed with column 'id'
Traceback (most recent call last):
File "differ.py", line 3, in
patch = csvdiff.diff_files('Skill.csv', 'Skill_1.csv', ['id'])
File "/usr/local/lib/python3.6/dist-packages/csvdiff/*init*.py", line 44,
in diff_files
ignore_columns=ignored_columns)
File "/usr/local/lib/python3.6/dist-packages/csvdiff/patch.py", line 204,
in create
from_indexed = records.index(from_records, index_columns)
File "/usr/local/lib/python3.6/dist-packages/csvdiff/records.py", line 58,
in index
raise InvalidKeyError('invalid column name {k} as key'.format(k=k))
csvdiff.records.InvalidKeyError: invalid column name 'id' as key
column 'id','name' is both in my testing files
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#51>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACMrAfkYUqIxhk60YGMZiRyC1mU7Py3ks5u2jFwgaJpZM4ZIDk6>
.
|
skill.csv
skill_1.csv
if example data can‘t reproduce the bug,I can email the original files. @larsyencken |
I cannot reproduce this:
|
I had similar problem. In my case the problem was that I had been exporting data from excel, which caused that saved file had "UTF-8 BOM" encoding. This has been causing csvdiff to detect additional unicode characters in the name of the first column - instead of the "id" the csvdiff has treated this as "\u010f\u00bb\u017cid". The problem has been solved when I changed the encoding to normal "UTF-8". |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In the API :diff_files example ,it can work sucessful with column 'name' but failed with column 'id'
Traceback (most recent call last):
File "differ.py", line 3, in
patch = csvdiff.diff_files('Skill.csv', 'Skill_1.csv', ['id'])
File "/usr/local/lib/python3.6/dist-packages/csvdiff/init.py", line 44, in diff_files
ignore_columns=ignored_columns)
File "/usr/local/lib/python3.6/dist-packages/csvdiff/patch.py", line 204, in create
from_indexed = records.index(from_records, index_columns)
File "/usr/local/lib/python3.6/dist-packages/csvdiff/records.py", line 58, in index
raise InvalidKeyError('invalid column name {k} as key'.format(k=k))
csvdiff.records.InvalidKeyError: invalid column name 'id' as key
column 'id','name' are both in my testing files
The text was updated successfully, but these errors were encountered: