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

Fix missing headers when exporting Project data #8159

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

garethrees
Copy link
Member

Project::Export uses the first request in the project to generate the CSV headers. However, if the request hasn't had data extracted, the headers for the dataset columns will be blank, even though other requests in the project may have had a dataset extraction.

This commit ensures that headers are always present by looking up the project's key set, and iterating through that to fetch the relevant submission value for that key, or otherwise assigning a nil value.

This has the benefit of ensuring that the keys/values exported are always in sync with the current project key set.

Fixes #8141.

@garethrees garethrees force-pushed the 8141-project-export-missing-headers branch from caea333 to f7549bb Compare March 11, 2024 12:11
@garethrees garethrees marked this pull request as ready for review March 12, 2024 16:32
Copy link
Member

@gbp gbp left a comment

Choose a reason for hiding this comment

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

Nice one. This works well

@gbp gbp removed their assignment Mar 13, 2024
Project::Export uses the first request in the project to generate the
CSV headers. However, if the request hasn't had data extracted, the
headers for the dataset columns will be blank, even though other
requests in the project may have had a dataset extraction.

This commit ensures that headers are always present by looking up the
project's key set, and iterating through that to fetch the relevant
submission value for that key, or otherwise assigning a nil value.

This has the benefit of ensuring that the keys/values exported are
always in sync with the current project key set.

Fixes #8141.
@garethrees garethrees force-pushed the 8141-project-export-missing-headers branch from f7549bb to 458abfa Compare March 13, 2024 11:50
@garethrees garethrees merged commit 86830a4 into develop Mar 13, 2024
5 of 6 checks passed
@garethrees garethrees deleted the 8141-project-export-missing-headers branch March 13, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project dataset export missing headers
2 participants