-
Notifications
You must be signed in to change notification settings - Fork 133
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
CSV Import: Handle re-importing of select_multiple questions #1852
Conversation
c731fb9
to
8b7a44f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
b57afa7
to
7f65f4a
Compare
if isinstance(result[k], str) and \ | ||
k in override_keys: | ||
result[k] = {} | ||
result[k] = merge_list_of_dicts([result[k], v]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should happen in the else part of this check? Should we re-raise the exception or silently ignore as this currently does? Does it mean that an empty submission is made or the row is skipped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would mean the row would be skipped & the previous value would be used on the field. I think re-raising the error and stopping the CSV Import process here would be the best option...
Here is an overview of what got changed by this pull request: Complexity increasing per file
==============================
- onadata/libs/utils/dict_tools.py 2
See the complete overview on Codacy |
8692556
to
90675f8
Compare
32ffc97
to
a13e705
Compare
7829944
to
2eaa305
Compare
The 'AttributeError' is usually raised during the CSV Import process if a user imports a CSV form that has an extra column(usually containing some extra information that may be useful for the users own analysis)
Handle cases where extra details are added on a select_multiple question column
select_multiple keys can have duplicates depending on the number of choices. This change ensures that the 'select_question_keys' list only has one entry for each question key and that the 'meta' key is excluded.
2eaa305
to
5407ec5
Compare
Changes / Features implemented
Steps taken to verify this change does what is intended
Side effects of implementing this change
string
value passed in theselect_multiple
field is actually useful? Should we store the data in the metadata ?Extra Info
Seems the issue documented in #1655 occurs when a user adds in a column(matching a
select_multiple
question) for extra information. i.e When using a form such as this and trying to import this kind of dataCloses #1655