heymenn commited on
Commit
c1442ee
·
verified ·
1 Parent(s): f6ecaa9

Update backend/data_service.py

Browse files
Files changed (1) hide show
  1. backend/data_service.py +1 -5
backend/data_service.py CHANGED
@@ -94,11 +94,7 @@ class DataService:
94
  df = self.data["files"]
95
 
96
  # Check if exists
97
- if not df.empty and file_id in df["file_id"].values:
98
- # Update? Or Skip? The original code did INSERT, so it might fail on duplicate PK usually?
99
- # SQLite: INSERT INTO file ... (if PK integrity error, it fails).
100
- # We will overwrite if exists for simplicity or skip.
101
- # Let's overwrite.
102
  file_id = file_data["file_id"]
103
  df = df[df["file_id"] != file_id]
104
 
 
94
  df = self.data["files"]
95
 
96
  # Check if exists
97
+ if not df.empty:
 
 
 
 
98
  file_id = file_data["file_id"]
99
  df = df[df["file_id"] != file_id]
100