Skip to content

Commit 318cbfc

Browse files
committed
[importer] polishing importer direct upload
1 parent b6b1874 commit 318cbfc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

desktop/libs/indexer/src/indexer/api3.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,15 @@ def guess_field_types(request):
246246
csv_data.append(row)
247247

248248
field_type_guesses = []
249-
for col in range(len(column_row)):
250-
column_samples = [sample_row[col] for sample_row in sample if len(sample_row) > col]
249+
for count, col in enumerate(column_row):
250+
column_samples = [sample_row[count] for sample_row in sample if len(sample_row) > count]
251251

252252
field_type_guess = guess_field_type_from_samples(column_samples)
253253
field_type_guesses.append(field_type_guess)
254254

255255
columns = [
256-
Field(column_row[i], field_type_guesses[i]).to_dict()
257-
for i in range(len(column_row))
256+
Field(column_row[count], field_type_guesses[count]).to_dict()
257+
for count, col in enumerate(column_row)
258258
]
259259

260260
format_ = {

desktop/libs/indexer/src/indexer/templates/importer.mako

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3185,7 +3185,7 @@ ${ commonheader(_("Importer"), "indexer", user, request, "60px") | n,unicode }
31853185
var files = $('#inputfile')[0].files[0];
31863186
fd.append('inputfile', files);
31873187
fd.append('fileFormat', ko.mapping.toJSON(viewModel.createWizard.source));
3188-
3188+
## $.post ??
31893189
$.ajax({
31903190
url: '/indexer/api/indexer/guess_field_types',
31913191
type: 'post',

0 commit comments

Comments
 (0)