bafbfaa5718e1de72b805237d2c350aec11de9fe,mindsdb/libs/data_sources/file_ds.py,FileDS,_getDataIo,#FileDS#Any#,58
Before Change
// lets try to figure out if its a csv
try:
data.seek(0)
full = len(data.read())
data.seek(0)
bytes_to_read = int(full*0.3)
dialect = csv.Sniffer().sniff(data.read(bytes_to_read))
After Change
data.seek(0)
first_few_lines = []
i = 0
for line in data:
i += 1
first_few_lines.append(line)
if i > 500:
break
dialect = csv.Sniffer().sniff("".join(first_few_lines))
data.seek(0)
// if csv dialect identified then return csv
if dialect:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: mindsdb/mindsdb
Commit Name: bafbfaa5718e1de72b805237d2c350aec11de9fe
Time: 2019-02-01
Author: george@cerebralab.com
File Name: mindsdb/libs/data_sources/file_ds.py
Class Name: FileDS
Method Name: _getDataIo
Project Name: mindsdb/mindsdb
Commit Name: 22bce0332c94639df80820a439e4c1893a5552f8
Time: 2019-02-01
Author: george@cerebralab.com
File Name: mindsdb/libs/data_sources/file_ds.py
Class Name: FileDS
Method Name: _getDataIo
Project Name: pyinstaller/pyinstaller
Commit Name: 39f8d2da9b3de8d0e2d11ad7d5b736a760fd4c11
Time: 2016-02-22
Author: garth@garthy.com
File Name: PyInstaller/archive/readers.py
Class Name: CArchiveReader
Method Name: checkmagic