Commit b5897534 authored by Htriedman's avatar Htriedman
Browse files

Update differential_privacy/utils/

parent 55d74783
Pipeline #6434 passed with stages
in 10 minutes and 48 seconds
......@@ -10,6 +10,15 @@ def gen_rho(epsilon, delta):
return (sqrt(epsilon+logterm) - sqrt(logterm))**2
def date_to_str(year, month, day):
if isinstance(year, str):
year = int(year)
if isinstance(month, str):
month = int(month)
if isinstance(day, str):
day = int(day)
return date(year=year, month=month, day=day).strftime("%Y-%m-%d")
def write_to_global_privacy_budget(spark, table, epsilon, year, month, day, delta=0, rho=None):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment