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

enable order for custom data source #26883

Merged
merged 1 commit into from Mar 18, 2020
Merged

Conversation

mkangia
Copy link
Contributor

@mkangia mkangia commented Mar 17, 2020

https://dimagi-dev.atlassian.net/browse/ICDS-1237

SUMMARY

We added a custom report for ICDS but didn't allow it to include order clause, this adds that.

PRODUCT DESCRIPTION

Report should be sorted with the column configured

Query being run now

In [2]: data_source.data_source.get_query_strings()
Out[2]: 'SELECT sum(CASE WHEN female_death_type IS NOT NULL AND female_death_type != \'\' AND age_at_death_yrs >= :p5ee5e5109b7
64a59a6d5ecf6a7343d4c THEN :param_1 ELSE :param_2 END) AS dead_preg_count, name AS name, age_at_death_yrs AS age_at_death_yrs,
female_death_type AS female_death_type, resident AS resident, date_death AS date_death, doc_id AS doc_id, supervisor_id AS supe
rvisor_id \nFROM "ucr_icds-cas_static-person_cases_v3_2ae0879a" GROUP BY doc_id, supervisor_id ORDER BY date_death DESC'

@mkangia mkangia added the product/custom Change will only impact users on a single project label Mar 17, 2020
Copy link
Member

@czue czue left a comment

Choose a reason for hiding this comment

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

thanks! a test would be nice if not too hard.

@mkangia
Copy link
Contributor Author

mkangia commented Mar 18, 2020

@czue i would be happy to add if there is already some setup of such custom data source i can build on, can you link me to tests already present for this?
i tried finding usages of the classes but could not find any in tests, and the way the test files are named, which are many i can't point to where it should be.

@czue
Copy link
Member

czue commented Mar 18, 2020

hmm, given that I didn't include any tests with the original PR (shame!) I imagine there isn't an easy test you can copy/latch on to.

@mkangia mkangia merged commit 99a351e into master Mar 18, 2020
@mkangia mkangia deleted the mk/add-sort-to-custom-data-source branch March 18, 2020 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product/custom Change will only impact users on a single project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants