Explorar el Código

Defending agains missing ParticipantId column in xlsx

Andrej hace 1 semana
padre
commit
f8d792d489
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      importXLSX.py

+ 4 - 1
importXLSX.py

@@ -331,7 +331,10 @@ def generateEntries(df,r,objFunc,pars):
    id=getId(df,r,pars)    
 #only use the first key from copyRows
    c=list(copyRows.keys())[0]
-   ar=df.at[r,c].split(copyRows[c])
+   try:
+      ar=df.at[r,c].split(copyRows[c])
+   except KeyError:
+      ar=[id]
    return [ {idField:id,c:x} for x in ar]   
 
 def setParsingObject(pars):