rdata fixes
This commit is contained in:
@@ -1110,7 +1110,7 @@ def rowhascoordinates(row):
|
||||
f1 = row.csvfilename
|
||||
u = row.user.user
|
||||
r = getrower(u)
|
||||
rowdata = rdata(f1)
|
||||
rowdata = rdata(csvfile=f1)
|
||||
hascoordinates = 1
|
||||
if rowdata != 0:
|
||||
try:
|
||||
@@ -1129,9 +1129,11 @@ def rowhascoordinates(row):
|
||||
|
||||
# Wrapper around the rowingdata call to catch some exceptions
|
||||
# Checks for CSV file, then for gzipped CSV file, and if all fails, returns 0
|
||||
def rdata(file,rower=rrower()):
|
||||
def rdata(csvfile=None,rower=rrower()):
|
||||
if csvfile is None:
|
||||
return 0
|
||||
try:
|
||||
res = rrdata(csvfile=file,rower=rower)
|
||||
res = rrdata(csvfile=csvfile,rower=rower)
|
||||
except pd.errors.EmptyDataError:
|
||||
res = 0
|
||||
except (IOError, IndexError, EOFError,FileNotFoundError):
|
||||
|
||||
Reference in New Issue
Block a user