-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance performance when exporting data on endpoint `api/v1/data/<for…
…m_id>.<format>` (#2460) * remove default ordering by id when exporting data from Data ViewSet the default ordering by id is making queries for run extremely slow when exporting large amounts of data. to sort data by id in ascending order, the query parameter sort={"_id":1} will be used. For more info read https://github.com/onaio/onadata/blob/main/docs/data.rst#sort-submitted-data-of-a-specific-form-using-existing-fields * remove duplicate db queries on endpoint /api/v1/data/<form_id>.csv * fix failing test * fix flaky test * fix flaky test * fix flaky test * remove futile test case Notes are excluded when exporting the csv. The column _notes is usually added in the CSV but its always overriden to be blank as per the implmentation in the CSVDataFrameBuilder class. So this test case is futile * use query param to sort exported data in XFormViewSet * disable pylint rule too-many-line for file * fix flaky tests fix flaky tests by ensuring queryset is always ordered * order records in test cases to avoid flaky results * optimize performance by removing redundant implementations * stop tracking onadata/test_data_media * disable pylint rules fixing the rules would require alot of refactor so disabling the rules will suffice for now * disable linting warning * address lint warning * address lint warnings * refactor code * address failing tests * address lint warnings * address linting error * address lint warning * fix failing test * refactor code * fix failing tests * refactor * suppress lint warning * get sort param from request * remove unused arg * update documentation * update documentation * sort paginated data by id * address linting error line too long * fix failing test * update test case
- Loading branch information
1 parent
88f3b00
commit 3fa23c5
Showing
22 changed files
with
2,323 additions
and
1,819 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.