Skip to content

fix: preserve existing data in update_excel function#4

Open
aymed10 wants to merge 1 commit intoyzfly:mainfrom
aymed10:fix/update-excel-data-loss
Open

fix: preserve existing data in update_excel function#4
aymed10 wants to merge 1 commit intoyzfly:mainfrom
aymed10:fix/update-excel-data-loss

Conversation

@aymed10
Copy link
Copy Markdown

@aymed10 aymed10 commented Mar 9, 2026

Problem
When calling update_excel to modify an existing Excel file (e.g. adding a new column), the function replaces the entire sheet with only the data sent by the LLM. All rows and untouched columns that weren't included in the update payload are lost.

Root Cause
The function writes new_df (the incoming data) directly to the sheet without first loading and merging with the existing sheet content.

Fix
Load the existing sheet first, merge the new columns into it, then save.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant