James McCool commited on
Commit
b8a722a
·
1 Parent(s): 8781f64

Enhance load_file function to ensure proper handling of unnamed columns by checking if the column name is a string before dropping. This improves data integrity during file uploads.

Browse files
Files changed (1) hide show
  1. global_func/load_file.py +1 -1
global_func/load_file.py CHANGED
@@ -106,7 +106,7 @@ def load_file(upload, site_var, type_var, sport_var, upload_type):
106
  return None, None
107
 
108
  for col in df.columns:
109
- if "Unnamed" in col:
110
  df = df.drop(columns=[col])
111
 
112
  if upload_type == 'portfolio':
 
106
  return None, None
107
 
108
  for col in df.columns:
109
+ if isinstance(col, str) and "Unnamed" in col:
110
  df = df.drop(columns=[col])
111
 
112
  if upload_type == 'portfolio':