larsyencken / csvdiff

Generate a diff between two tabular datasets expressed in CSV files.
BSD 3-Clause "New" or "Revised" License
132 stars 31 forks source link

--style=summary gives an error output #13

Closed jasperonline closed 8 years ago

jasperonline commented 8 years ago

When running csvdiff with style pretty and compact it works as expected but with --style=summary I get the following error:

Traceback (most recent call last): File "/bin/csvdiff", line 11, in sys.exit(csvdiff_cmd()) File "/usr/lib/python2.7/site-packages/click/core.py", line 716, in call return self.main(_args, _kwargs) File "/usr/lib/python2.7/site-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/usr/lib/python2.7/site-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, _ctx.params) File "/usr/lib/python2.7/site-packages/click/core.py", line 534, in invoke return callback(_args, kwargs) File "/usr/lib/python2.7/site-packages/csvdiff/init**.py", line 136, in csvdiff_cmd _diff_and_summarize(from_csv, to_csv, index_columns, ostream) File "/usr/lib/python2.7/site-packages/csvdiff/init.py", line 166, in _diff_and_summarize _summarize_diff(diff, len(from_records), stream=stream) AttributeError: DictReader instance has no attribute 'len'

Running Fedora 23 and Python 2.7, when trying to run Python 3.4 I get the following error (for any style):

Traceback (most recent call last): File "/bin/csvdiff", line 7, in from csvdiff import csvdiff_cmd

If more information is required please let me know.

larsyencken commented 8 years ago

Thanks for the report. With a quick check on Python 3.5.1 and csvdiff 0.3.0, I can confirm that --style=summary is broken, but --style=compact and --style=pretty seem to be working.

I'll look into it.

larsyencken commented 8 years ago

This is actually a bug that's fixed on master, but wasn't in the current release. I just put out a new 0.3.1 release with the fix. Try installing that, or cloning and installing from Github.

Let me know if you have any trouble.

jasperonline commented 8 years ago

Works for me, thanks.