Skip to content

Commit

Permalink
reland hash secondary exposures and undelegated secondary exposures (…
Browse files Browse the repository at this point in the history
  • Loading branch information
xinlili-statsig authored Jun 26, 2024
1 parent 6eb0093 commit a65c506
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion statsig/client_initialize_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def config_to_response(config_name, config_spec):
result = {
"name": hashed_name,
"rule_id": eval_result.rule_id,
"secondary_exposures": eval_result.secondary_exposures,
"secondary_exposures": hash_exposures(eval_result.secondary_exposures, hash_algo),
"value": False
}

Expand Down Expand Up @@ -134,6 +134,11 @@ def populate_layer_fields(config_spec, eval_result, result, hash_algo):

result["undelegated_secondary_exposures"] = eval_result.undelegated_secondary_exposures or []

def hash_exposures(exposures: list, algo: HashingAlgorithm):
for exposure in exposures:
exposure['gate'] = hash_name(exposure['gate'], algo)
return exposures

def filter_nones(arr):
return dict([i for i in arr if i is not None])

Expand Down

0 comments on commit a65c506

Please sign in to comment.