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

Formula of derived KPIs only support ratios #98

Open
shansfolder opened this issue Apr 10, 2017 · 1 comment
Open

Formula of derived KPIs only support ratios #98

shansfolder opened this issue Apr 10, 2017 · 1 comment

Comments

@shansfolder
Copy link
Contributor

The following code in Experiment.delta

pattern = '([a-zA-Z][0-9a-zA-Z_]*)'
self.kpis.loc[:,kpiName] = eval(re.sub(pattern, r'self.kpis.\1.astype(float)', dk['formula']))

will only work for fomulas with simple ratios (and also too hacky).

However, I found that some of the KPIs here requires sum/count/>0, etc...

@gbordyugov
Copy link
Contributor

... and using eval on unvalidated input is a potential security breach.

@shansfolder shansfolder changed the title Formula of derived KPIs only support rasios Formula of derived KPIs only support ratios Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants