-
Notifications
You must be signed in to change notification settings - Fork 79
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
Remove multiple duplicates in choice sheets #303
Conversation
for more information, see https://pre-commit.ci
Isn't this regressing to the same functionality / issue we had before I removed the duplicate check? @manjitapandey had a form where yes/no choices had a different list name, but they were stripped out as we already have yes/no choices in our mandatory fields (giving an invalid form). I removed the duplicate check as it's valid to have duplicates in the choices sheet. Is this causing issues somehow? |
We used to check if name field in choice sheet is unique or not, and removed other duplicates despite different |
So in this PR we check for not only unique name field but the unique combination of |
Since its not because of the translation, rather the duplication of option. I believe we are good to go ahead with merging the PR and we also tested it on local the questions are visible now and no duplication of options. |
This may not make a difference, but you're supposed to have the 2 letter ISO abbreviation, so it'd be label::English(en), etc... |
For now, i have released the recent fix to work around, we can see this translation issue later on if we encounter related issue again. |
This issue was originally due to multiple label field for english lang, custom form already had |
proposed solution would be to detect invalid label and convert them to valid labels while injecting mandatory fields. |
The We have the same when we had conflicting values in the Perhaps we need to specify one of the columns to take precedent over the other, likely the user uploaded XLSForm value. |
Issue:
Description:
This PR addresses the issue of duplicate combinations of list_name and name fields in the "choices" sheet when allow_choices_duplicates is enabled. It ensures that only unique combinations are retained after the merging process, improving the accuracy of the choices sheet and preventing redundancy.
Key Changes:
Duplicate Removal in Choices Sheet:
Added logic to remove duplicates based on the list_name and name columns when processing the "choices" sheet.
Implemented using the
drop_duplicates(subset=['list_name', 'name'])
method, ensuring the choice lists have unique entries.Before the Fix:
When allow_choices_duplicates was enabled, the "choices" sheet could have multiple duplicate entries for the same list_name and name combination, leading to redundant data in the final output.
After the Fix:
The function now ensures that only unique combinations of list_name and name are retained, improving the integrity of the choices data while retaining necessary survey structure.