baha-99 commited on
Commit
fef2d3b
·
1 Parent(s): c4b00fb

debug:Excel file does not have 'question' column2

Browse files
Files changed (1) hide show
  1. bot_telegram.py +5 -0
bot_telegram.py CHANGED
@@ -229,6 +229,8 @@ class TelegramBot:
229
  # Excel'i oku ve soru sayısını hesapla
230
  try:
231
  df = pd.read_excel(io.BytesIO(file_bytes), sheet_name='rfp')
 
 
232
  except Exception as e:
233
  await update.message.reply_text(
234
  f"❌ Error reading Excel file: {str(e)}\n"
@@ -242,7 +244,10 @@ class TelegramBot:
242
  )
243
  return
244
 
 
 
245
  if 'question' not in df.columns:
 
246
  await update.message.reply_text(
247
  "❌ Error: Excel file does not have 'question' column.\n"
248
  "Please make sure your Excel file has a column named 'question'."
 
229
  # Excel'i oku ve soru sayısını hesapla
230
  try:
231
  df = pd.read_excel(io.BytesIO(file_bytes), sheet_name='rfp')
232
+ # Add debug logging
233
+ logging.info(f"Excel columns found: {df.columns.tolist()}")
234
  except Exception as e:
235
  await update.message.reply_text(
236
  f"❌ Error reading Excel file: {str(e)}\n"
 
244
  )
245
  return
246
 
247
+ # Add debug logging before check
248
+ logging.info("Checking for 'question' column...")
249
  if 'question' not in df.columns:
250
+ logging.info("'question' column not found!")
251
  await update.message.reply_text(
252
  "❌ Error: Excel file does not have 'question' column.\n"
253
  "Please make sure your Excel file has a column named 'question'."