okfn / messytables

Tools for parsing messy tabular data. This is now superseded by https://github.com/frictionlessdata/tabulator-py
http://messytables.readthedocs.io/
387 stars 110 forks source link

type_guess throws an error #29

Closed nigelbabu closed 11 years ago

nigelbabu commented 11 years ago

See https://gist.github.com/4502515 for the test cases and https://github.com/okfn/messytables/blob/master/horror/simple.xls is the xls file used.

When I run messytest1.py from the gist with messytables 0.3.0, it works fine. When I run it with messytables 0.4.0 or against master, it throws the following error

  File "./messytest.py", line 15, in <module>
    main()
  File "./messytest.py", line 10, in main
    types = ms.types.type_guess(row_set.sample)
  File "/home/nigel/.virtualenvs/serviceconverters/local/lib/python2.7/site-packages/messytables/types.py", line 159, in type_guess
    guess = type.test(cell.value)
  File "/home/nigel/.virtualenvs/serviceconverters/local/lib/python2.7/site-packages/messytables/types.py", line 100, in test
    if not is_date(value):
  File "/home/nigel/.virtualenvs/serviceconverters/local/lib/python2.7/site-packages/messytables/dateparser.py", line 7, in is_date
    return date_regex.match(value)
TypeError: expected string or buffer
domoritz commented 11 years ago

Should be fixed with 2b48bc346abe9395f9a1cdb62eb1b70bc93fe66b