Skip to content

Commit

Permalink
avoid error if access results key is not found for erasures
Browse files Browse the repository at this point in the history
in cases where connector is disabled, there won't be an entry
in the acces results for that connector's key.
instead of throwing a key error, we instead just pass in an empty list
to the erasure execution, which will not actually execute anyway.
  • Loading branch information
adamsachs committed Dec 14, 2022
1 parent 56d2633 commit a2aaa72
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/fides/api/ops/task/graph_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,12 +726,14 @@ def termination_fn(*dependent_values: int) -> Tuple[int, ...]:
t.erasure_request,
access_request_data[
str(k)
], # Pass in the results of the access request for this collection
*[
access_request_data[
str(upstream_key)
] # Additionally pass in the original input data we used for the access request. It's helpful in
] # Pass in the results of the access request for this collection
if str(k) in access_request_data
else [], # handle case with no read entry, i.e. disabled connector
*[ # Additionally pass in the original input data we used for the access request. It's helpful in
# cases like the EmailConnector where the access request doesn't actually retrieve data.
access_request_data[str(upstream_key)]
if str(upstream_key) in access_request_data
else [] # handle case with no read entry, i.e. disabled connector
for upstream_key in t.input_keys
],
)
Expand Down

0 comments on commit a2aaa72

Please sign in to comment.