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

Handle dynamic choice names while generating SAV export #1806

Merged
merged 3 commits into from
Apr 9, 2020

Conversation

DavisRayM
Copy link
Contributor

@DavisRayM DavisRayM commented Apr 6, 2020

Changes / Features implemented

  • Handle variable names with curly braces before creating sav exports

Steps taken to verify this change does what is intended

  • Added test

Side effects of implementing this change

Closes #1803

@DavisRayM DavisRayM force-pushed the 1803-dynamic-labels branch 4 times, most recently from bb62ddf to 206ae6e Compare April 8, 2020 06:42
self.assertEqual(rows[0][2], b'name')
self.assertEqual(rows[1][2], b'Davis')
self.assertEqual(rows[0][3], b'brand_known')
self.assertEqual(rows[1][3], b'${text} a')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavisRayM Are we supposed to replace ${text} with the real value i.e. '${text} a' becomes 'his a'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we do. I'll work on making this happen.

I think we need to do this since the csv export shows his a instead of ${text} a will work on this

ivermac
ivermac previously approved these changes Apr 8, 2020
Copy link
Contributor

@ivermac ivermac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me

@DavisRayM DavisRayM changed the title Handle dynamic choice names while generating SAV export [WIP] Handle dynamic choice names while generating SAV export Apr 8, 2020
@DavisRayM DavisRayM changed the title [WIP] Handle dynamic choice names while generating SAV export Handle dynamic choice names while generating SAV export Apr 8, 2020
Curly braces are categorized as special characters in SPSS. Including
them in the 'var_name' raises a syntax error
Replace dynamic values i.e ${text} with actual value retrieved from row
data while creating sav exports
@faith-mutua
Copy link

@DavisRayM this has passed QA. I have tested the following scenarios

  • Sav exports work - Passed. They work even for some forms where they were failing before.
  • Sav exports work for forms with dynamic choices. - Passed
  • Sav exports still work with dynamic choices within a repeat group, group, and nested group. - Passed
  • Sav exports return the correct data in all the above scenarios. - Passed
  • (Nice to Have) Please test out other forms of exports - Passed. Other data export formats are working as expected.

@faith-mutua faith-mutua added the QA+ PR passed QA testing label Apr 9, 2020
@DavisRayM DavisRayM merged commit cbd47ff into master Apr 9, 2020
@DavisRayM DavisRayM deleted the 1803-dynamic-labels branch April 9, 2020 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA+ PR passed QA testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid variable name error when trying to export a form with dynamic names/labels to .sav
4 participants