-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Basic checks
- I can confirm that there isn't a seperate issue filed related to this bug.
Reproducible Example
session_budget = RhoZCDPBudget(rho=float('inf'))
session = Session.from_dataframe(
session_budget,
"checkouts",
checkouts_df,
protected_change=AddMaxRowsInMaxGroups("author", 5, 5),
)
keyset = KeySet.from_dataframe(
books_df.select("title", "author", "isbn"),
)
query = (QueryBuilder("checkouts")
.groupby(keyset)
.sum("publication_date", low=0, high=3000, mechanism=SumMechanism.LAPLACE)
)
budget = RhoZCDPBudget(1)
print(session._noise_info(query, budget))Bug Description
The above code fails with:
UnsupportedMetricError: Input metric does not have the expected inner metric. Maybe IfGroupedBy(column='author', inner_metric=SumOf(inner_metric=SymmetricDifference()))?
The same happens if you have a table with privacy IDs and use both MaxGroupsPerID and MaxRowsPerGroupPerID with Laplace noise:
session_budget = RhoZCDPBudget(rho=float('inf'))
session = Session.from_dataframe(
session_budget,
"checkouts",
checkouts_df,
protected_change=AddRowsWithID("member_id"),
)
query = (QueryBuilder("checkouts")
.enforce(MaxGroupsPerID("author", 5))
.enforce(MaxRowsPerGroupPerID("author", 5))
.groupby(keyset)
.sum("publication_date", low=0, high=3000, mechanism=SumMechanism.LAPLACE)
)
budget = RhoZCDPBudget(1)
print(session._noise_info(query, budget))
UnsupportedMetricError: Input metric does not have the expected inner metric. Maybe IfGroupedBy(column='author', inner_metric=SumOf(inner_metric=SymmetricDifference()))?
Expected Behavior
This should not fail.
Version Info
main
Platform
No response
Metadata
Metadata
Assignees
Labels
No labels