Skip to content

Commit

Permalink
[syft/action_service] only add blob permission if the entry's id is n…
Browse files Browse the repository at this point in the history
…ot None
  • Loading branch information
khoaguin committed Jul 5, 2024
1 parent 54ba6b3 commit 787af9b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/syft/src/syft/service/action/action_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,14 +565,21 @@ def store_permission(

def blob_permission(
x: SyftVerifyKey | None = None,
) -> ActionObjectPermission:
return ActionObjectPermission(result_blob_id, read_permission, x)
) -> ActionObjectPermission | None:
if result_blob_id:
return ActionObjectPermission(result_blob_id, read_permission, x)
else:
return None

if len(output_readers) > 0:
store_permissions = [store_permission(x) for x in output_readers]
self.store.add_permissions(store_permissions)

blob_permissions = [blob_permission(x) for x in output_readers]
blob_permissions = [
blob_permission(x)
for x in output_readers
if blob_permission(x) is not None
]
blob_storage_service.stash.add_permissions(blob_permissions)

return set_result
Expand Down

0 comments on commit 787af9b

Please sign in to comment.