You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found that it fails a few different ways on files consisting of just a single field or column:
first the csv sniff module can't determine the delimiter. This can be bypassed by specifying one (even tho none exists in the data).
$ gristle_freaker col0.csv -c 0 -d','
Traceback (most recent call last):
File "/usr/local/bin/gristle_freaker", line 487, in
sys.exit(main())
File "/usr/local/bin/gristle_freaker", line 71, in main
dialect = get_dialect(opts, files)
File "/usr/local/bin/gristle_freaker", line 117, in get_dialect
my_file.analyze_file()
File "/usr/local/lib/python2.7/site-packages/gristle/file_type.py", line 98, in analyze_file
self.dialect.has_header = self._get_has_header(self._has_header)
File "/usr/local/lib/python2.7/site-packages/gristle/file_type.py", line 203, in _get_has_header
return csv.Sniffer().has_header(sample)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/csv.py", line 392, in has_header
rdr = reader(StringIO(sample), self.sniff(sample))
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/csv.py", line 184, in sniff
raise Error, "Could not determine delimiter"
_csv.Error: Could not determine delimiter
Secondly, the cvs sniff module fails on hasheader - this can be bypassed by specifying hasheader false in some other gristle utilities - but not this one.
$ gristle_freaker col0.csv -c 0 -d',' --hasheader false
Traceback (most recent call last):
File "/usr/local/bin/gristle_freaker", line 487, in
sys.exit(main())
File "/usr/local/bin/gristle_freaker", line 79, in main
opts.sampling_rate)
File "/usr/local/bin/gristle_freaker", line 187, in build_freq
for fields in csv.reader(fileinput.input(files), dialect):
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fileinput.py", line 253, in next
line = self.readline()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fileinput.py", line 351, in readline
return self.readline()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fileinput.py", line 345, in readline
self._file = open(self._filename, self._mode)
IOError: [Errno 2] No such file or directory: 'false'
The text was updated successfully, but these errors were encountered:
I've found that it fails a few different ways on files consisting of just a single field or column:
$ gristle_freaker col0.csv -c 0 -d','
Traceback (most recent call last):
File "/usr/local/bin/gristle_freaker", line 487, in
sys.exit(main())
File "/usr/local/bin/gristle_freaker", line 71, in main
dialect = get_dialect(opts, files)
File "/usr/local/bin/gristle_freaker", line 117, in get_dialect
my_file.analyze_file()
File "/usr/local/lib/python2.7/site-packages/gristle/file_type.py", line 98, in analyze_file
self.dialect.has_header = self._get_has_header(self._has_header)
File "/usr/local/lib/python2.7/site-packages/gristle/file_type.py", line 203, in _get_has_header
return csv.Sniffer().has_header(sample)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/csv.py", line 392, in has_header
rdr = reader(StringIO(sample), self.sniff(sample))
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/csv.py", line 184, in sniff
raise Error, "Could not determine delimiter"
_csv.Error: Could not determine delimiter
$ gristle_freaker col0.csv -c 0 -d',' --hasheader false
Traceback (most recent call last):
File "/usr/local/bin/gristle_freaker", line 487, in
sys.exit(main())
File "/usr/local/bin/gristle_freaker", line 79, in main
opts.sampling_rate)
File "/usr/local/bin/gristle_freaker", line 187, in build_freq
for fields in csv.reader(fileinput.input(files), dialect):
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fileinput.py", line 253, in next
line = self.readline()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fileinput.py", line 351, in readline
return self.readline()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fileinput.py", line 345, in readline
self._file = open(self._filename, self._mode)
IOError: [Errno 2] No such file or directory: 'false'
The text was updated successfully, but these errors were encountered: