call next() the right way (#4804)

This commit is contained in:
timifasubaa 2018-04-11 13:20:14 -07:00 committed by Maxime Beauchemin
parent 3c29ca79ae
commit 20f46eede5

View File

@ -869,7 +869,7 @@ class HiveEngineSpec(PrestoEngineSpec):
"""Uploads a csv file and creates a superset datasource in Hive.""" """Uploads a csv file and creates a superset datasource in Hive."""
def get_column_names(filepath): def get_column_names(filepath):
with open(filepath, 'rb') as f: with open(filepath, 'rb') as f:
return unicodecsv.reader(f, encoding='utf-8-sig').next() return next(unicodecsv.reader(f, encoding='utf-8-sig'))
table_name = form.name.data table_name = form.name.data
filename = form.csv_file.data.filename filename = form.csv_file.data.filename