Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -194,7 +194,8 @@ def save_to_csv_flat(all_extracted_values, schedule1_values, client_name="Unknow
|
|
194 |
new_row["Other Income - Schedule 1, Line 8"] = schedule1_values[2] if schedule1_values[2] != '' else '0'
|
195 |
|
196 |
# Append and save
|
197 |
-
|
|
|
198 |
print(f"CSV rows after append: {len(df)}")
|
199 |
df.to_csv(csv_path, index=False)
|
200 |
print(f" Data saved to CSV: {csv_path}")
|
|
|
194 |
new_row["Other Income - Schedule 1, Line 8"] = schedule1_values[2] if schedule1_values[2] != '' else '0'
|
195 |
|
196 |
# Append and save
|
197 |
+
if not ((df == new_row.iloc[0]).all(axis=1)).any():
|
198 |
+
df = pd.concat([df, pd.DataFrame([new_row])], ignore_index=True)
|
199 |
print(f"CSV rows after append: {len(df)}")
|
200 |
df.to_csv(csv_path, index=False)
|
201 |
print(f" Data saved to CSV: {csv_path}")
|