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

Avoid z_score numeric exception for conversion rates >1 #503

Merged
merged 1 commit into from
Sep 20, 2017

Conversation

cmantas
Copy link
Contributor

@cmantas cmantas commented Sep 20, 2017

At normal operation, it's not possible for an experiment alternative
to have a participant_count > completed_count.
However, by manually using increment_participation
(for a custom use-case or by accident) you can arrive
on such a situation.

If that happens, Zscore.calculate produces an error that
propagates all the way up to the web view.

Solution:
In the cornercase of a conversion rates taking a value >1,
it makes no sense to calculate a zscore value at all.
An escape clause was added

At normal operation, it's not possible for an experiment
 to have a `participant_count` > `completed_count`.
However, by manually using `increment_participation`
 (for a custom use-case or by accident) you can arrive
 on such a situation.

If that happens, `Zscore.calculate` produces an error that
 propagates all the way up to the web view.

Solution:
In the cornercase of a conversion rates taking a value >1,
 it makes no sense to calculate a zscore value at all.
An escape clause was added
@andrew
Copy link
Member

andrew commented Sep 20, 2017

Thanks!

@andrew andrew merged commit 13e11b6 into splitrb:master Sep 20, 2017
@andrew
Copy link
Member

andrew commented Sep 21, 2017

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.

2 participants