fix(reader): default to first sheet by index if no ID found #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes bug where we assumed that the first sheet in the spreadsheet would have ID 0 but this can be false like when the user rearranges the sheets or deletes the first sheet.
This is a breaking change for some users that were inadvertently getting the first sheet created even if it wasn't the first sheet by index.
Additionally, this adds a new util function,
get_sheet_name_from_index
, that works similarily toget_sheet_name_from_id
. If we do decide to add new named input for user to select a sheet by index instead of by name then this will allow that feature work to be trivial. For now, it's just used to get the first sheet by index as a fallback if no ID is found in the user input and no sheet name is provided.Closes #51