Pulastya B commited on
Commit
6333b7e
·
1 Parent(s): 9566116

Fix: Add ultimate fallback to always use session context when no file_path provided

Browse files
Files changed (1) hide show
  1. src/session_memory.py +10 -0
src/session_memory.py CHANGED
@@ -289,6 +289,16 @@ class SessionMemory:
289
  resolved["target_col"] = self.last_target_col
290
  print(f"[DEBUG] Resolved target_col from session: {self.last_target_col}")
291
 
 
 
 
 
 
 
 
 
 
 
292
  print(f"[DEBUG] resolve_ambiguity returning: {resolved}")
293
  return resolved
294
 
 
289
  resolved["target_col"] = self.last_target_col
290
  print(f"[DEBUG] Resolved target_col from session: {self.last_target_col}")
291
 
292
+ # 🔥 ULTIMATE FALLBACK: If no file_path resolved and we have session data, use it
293
+ # This handles cases where user doesn't use ambiguous refs but still wants to use session context
294
+ if not resolved.get("file_path") and self.last_dataset:
295
+ resolved["file_path"] = self.last_dataset
296
+ print(f"[DEBUG] Ultimate fallback: Using last_dataset from session: {self.last_dataset}")
297
+
298
+ if not resolved.get("target_col") and self.last_target_col:
299
+ resolved["target_col"] = self.last_target_col
300
+ print(f"[DEBUG] Ultimate fallback: Using last_target_col from session: {self.last_target_col}")
301
+
302
  print(f"[DEBUG] resolve_ambiguity returning: {resolved}")
303
  return resolved
304