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 histograms for TIV variable #11

Closed
wants to merge 2 commits into from
Closed

Conversation

Marigold
Copy link
Collaborator

"PARAM_query=SELECT \"tiv\",\"dataset\",\"gender\",\"agegroup\",\"alzheimerbroadcategory\" FROM cde_features_a WHERE \"tiv\" IS NOT NULL",

returns no results because all tiv values are NULL. This PR fixes that and returns error to job_result table.

@mock.patch('histograms.io_helper.fetch_data')
@mock.patch('histograms.io_helper.get_results')
@mock.patch('histograms.io_helper.save_results')
def test_main(mock_save_results, mock_get_results, mock_fetch_data):
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, tests!

@Marigold
Copy link
Collaborator Author

With this change, call to /mining/job is returning

{
    "algorithm": "python-histograms",
    "error": "Cannot handle job results of shape ch.chuv.lren.woken.core.model.Shapes$highcharts$@15b89cc4 produced by function python-histograms with data Some(), error Some(Dependent variable tiv is empty.)",
    "jobId": "cf21e908-0f9a-41e6-9472-f71e7dbcfcb9",
    "node": "federation",
    "shape": "text/plain+error",
    "timestamp": 1521319557
}

is that acceptable?

@ludovicc
Copy link
Contributor

No, you are returning an error message and mark it as a highchart json. It should have been a json that defines a highchart graph saying that there is no data for the variable. I will have a look and fix it

@Marigold
Copy link
Collaborator Author

Thanks for correcting me, I've changed the output type to Shapes.ERROR and woken now returns

{
    "algorithm": "python-histograms",
    "error": "Dependent variable tiv is empty.",
    "jobId": "270a4d45-7e69-4a48-8572-82a36cac87e2",
    "node": "federation",
    "shape": "text/plain+error",
    "timestamp": 1521368504
}

I hope it's correct now.

@Marigold
Copy link
Collaborator Author

Closing this in favor of #13 with distributed mode.

@Marigold Marigold closed this Mar 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python-histogram fails on TIV variable
2 participants