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

Always set index #828

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

Always set index #828

wants to merge 1 commit into from

Conversation

newzealandpaul
Copy link

The index should always be set, because it will be accessed later in the script and generate a runtime error

What does this PR do?

Sets the index variable to the config's id_start_number, even if id_field was already in the header

Why is this desirable ?

When each row is iterated later on in the script, index will be accessed. If it is not set, a runtime error occurs.

        if config["id_field"] in headers:
            row[config["id_field"]] = index + reader.line_num - 2

The index should always be set, because it will be accessed later in the script and generate a runtime error
@mjordan
Copy link
Owner

mjordan commented Oct 3, 2024

Thanks @newzealandpaul . How would I test this change?

@newzealandpaul
Copy link
Author

newzealandpaul commented Oct 3, 2024 via email

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.

2 participants