roskakori / cutplace

validate data stored in CSV, PRN, ODS or Excel files
http://cutplace.readthedocs.org/
GNU Lesser General Public License v3.0
18 stars 20 forks source link

cutfile ignoring data format property Header #93

Closed ropable closed 9 years ago

ropable commented 9 years ago

Running cutplace 0.84, I'm trying to undertake basic validation of a CSV file.

Upon trying the validate the data, I get the following error:

$ cutplace cid_lpr.csv lpr.csv 
INFO:cutplace:read CID from "cid_lpr.csv"
INFO:cutplace:validate "lpr.csv"
ERROR:cutplace:  lpr.csv (R1C2): cannot accept field 'cost_centre_no': value must be an integer number: 'Cost Centre'

The library appears to be trying to validate the first row in the CSV, despite setting the data format Header = 1 in the CID. The CID appears to be a valid, and any suggestions/assistance you can provide would be appreciated.

roskakori commented 9 years ago

Thanks for pointing this out, it's fixed with version 0.8.5, available form PyPI.

The validation of your example still fails but this seems to be caused by broken data:

INFO:cutplace:read CID from "cid_lpr.csv"
INFO:cutplace:validate "lpr.csv"
ERROR:cutplace:  lpr.csv (R47C1): values for ['serial_no'] must be unique: ('DEC-2JPK92S.',) (see also: lpr.csv (R42C1): location of first occurrence)
ropable commented 9 years ago

Yes, the second validation failure was one that I was actually trying to induce during validation. Thanks for the fix!