fix(qual): fix format for qualitative multiple select questions DEV-2233 - #347
Conversation
|
@greptileai review |
|
|
@greptileai review |
|
@greptileai |
|
Looking at the actual code in the diff, the implementation already handles this correctly — unrecognized UUIDs are silently dropped because You're right, and the behavior is both correct and intentional given that KPI data can include choices deleted after collection. The silent drop is the right call here. Shall I remember this as a rule: "In formpack, silently dropping unrecognized/stale UUIDs from qualitative field responses is acceptable and intentional — KPI data may reference deleted choices"? Tip: You can customize Greptile's behavior for this repo with |
### 📣 Summary Fixes the qualitative manual multiple select data export ### 📖 Description The one hot data export for manual qualitative multiple select data was [fixed on formpack](kobotoolbox/formpack#347). In `import_export_task.py`, the `SubmissionExportTaskBase.get_export_object` we pass for_output=True down to `get_submissions` in order to resolve the choice UUIDs into their corresponding human-readable labels. We have also added `_uuid` and `meta/rootUuid` to the additional_fields list in `_get_fields_and_groups()` to retrieve the qualitative payload correctly. ### 👀 Preview steps 1. Create a project with an active qualSelectMultiple question and ensure there are submissions with multiple tags/options selected (You can achieve this by having an audio question, then clicking on "Open", in the Data view, in the audio cell, and then in the "Analysis" tab you can add a multiple choice question and select a few options) 3. Go to the project's Data > Downloads 4. Select an export format (e.g., XLS) and check the "Single and separate columns" advanced option 5. Generate and download the export 6. Open the export file and verify that the Qual multiple-choice field has successfully expanded into multiple binary columns, and that the single column version displays the selected labels separated by spaces instead of commas
Summary
Refactor QualSelectMultipleField to export ordinal columns containing text values
Description
tests/test_additional_field_exports.pyPreview steps
Run pytest, this is covered by unit tests.