Skip to content

Calling result() when privacy budget is 0 should return a Python exception #263

@alejandrosame

Description

@alejandrosame

Description

Right now, when we call result() after using all the privacy budget of an algorithm, the library raises C++ errors, potentially killing the Python session.

How to Reproduce

From an interactive session execute:

>>> from pydp.algorithms.laplacian import Count
>>> c = Count(1)
>>> c.add_entries([1,1,1,1,1])
>>> c.result()
4
>>> c.result()
2020-08-22 14:46:29  ERROR  numerical-mechanisms.h : 118 : privacy_budget has to be in the interval (0, 1], but is 0
2020-08-22 14:46:29  ERROR  numerical-mechanisms.h : 118 : privacy_budget has to be in the interval (0, 1], but is 0
-8388603

Expected Behavior

When calling result() once the privacy budget is completely used, we should raise a ValueError.

Metadata

Metadata

Assignees

Labels

Severity: 1 - Critical 🔥Causes a failure of the complete software system, subsystem or a program within the systemType: Bug 🐛Some functionality not working in the codebase as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions