Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.2k
gh-102140: fix false negative in csv.Sniffer.has_header#103341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
60d7501
1636e7b
7020dd5
e2a76d9
02b645d
747cbc8
6db356f
38166fe
2fe30c0
b78cd78
9ce92ba
ccf9d2e
8ae2789
90c70b4
1c2fef7
ba6083c
2b8c27e
7ba8c83
92f63f6
a1d84d6
ca440f7
f60bc70
22d8b55
2852554
1a9ed20
d381110
3384c99
e306d93
d167d6d
17d4a7e
95c1dae
b978f18
d7d2be5
d8f180e
eb80cbb
3c62566
9754874
e1f3e1b
891b657
d01e7a4
a390543
57c58ce
42c00e1
84b6dda
6950c1e
bffbcf7
b3d0bf2
b6a557c
8561127
04ee833
a0a5544
0ab2649
1d63e98
5aabf60
61dfb3e
34e52fa
d0f33be
8fe8b7c
3e2b806
2e8d2f2
b77dc4c
bb136bb
dcf1af4
920cc1e
1971df6
8746e64
a9ea1be
6d139a6
141cf5d
9686653
680c67b
149938a
4b22c77
2092173
95f2b61
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -414,7 +414,7 @@ def has_header(self, sample): | ||
if len(row) != columns: | ||
continue # skip rows that have irregular number of columns | ||
#checking if all col are strings | ||
for cols in list(columnTypes.keys()): | ||
johnD18 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
if row[cols].isnumeric(): | ||
col_are_strings = False | ||
@@ -447,7 +447,7 @@ def has_header(self, sample): | ||
# finally, compare results against first row and "vote" | ||
# on whether it's a header | ||
hasHeader = 0 | ||
# here we added the special case where all cols are strings anddictionary has been emptied | ||
johnD18 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
if not columnTypes and col_are_strings==True and columns>0: | ||
johnD18 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
#dictionary now takes the average length of strings | ||
columnTypes[0] = int(average_size/columns) | ||
johnD18 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page.
johnD18 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||