Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with duplicate sheet names in Google Sheets output #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amihos
Copy link

@amihos amihos commented Apr 30, 2024

This commit addresses an issue where the script would crash if a new solution had the same name as a previous one, since the Google Sheets API does not allow multiple sheets with the same name. To resolve this, the code now checks if a sheet with the same name already exists in the spreadsheet, and if so, appends a unique identifier (a timestamp) to the sheet name before creating it. This ensures that each sheet has a unique name and prevents the script from crashing.

Changes include:

  • Modifying the write_workplan function in gsheets.py to check if a sheet with the same name already exists in the spreadsheet.
  • Appending a unique identifier (a timestamp) to the sheet name if a sheet with the same name already exists.
  • Updating the logger messages to reflect the new behavior.

This change should improve the reliability of the script and prevent crashes due to duplicate sheet names.

This commit addresses an issue where the script would crash if a new solution had the same name as a previous one, since the Google Sheets API does not allow multiple sheets with the same name. To resolve this, the code now checks if a sheet with the same name already exists in the spreadsheet, and if so, appends a unique identifier (a timestamp) to the sheet name before creating it. This ensures that each sheet has a unique name and prevents the script from crashing.

Changes include:

* Modifying the `write_workplan` function in `gsheets.py` to check if a sheet with the same name already exists in the spreadsheet.
* Appending a unique identifier (a timestamp) to the sheet name if a sheet with the same name already exists.
* Updating the logger messages to reflect the new behavior.

This change should improve the reliability of the script and prevent crashes due to duplicate sheet names.
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