Skip to content

Commit

Permalink
revert double syft message
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-milea committed Oct 4, 2024
1 parent 8337b60 commit 06a356a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
7 changes: 3 additions & 4 deletions packages/syft/src/syft/client/syncing.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def handle_sync_batch(
obj_diff_batch: ObjectDiffBatch,
share_private_data: dict[UID, bool],
mockify: dict[UID, bool],
) -> tuple[SyftSuccess, SyftSuccess]:
) -> SyftSuccess:
# Infer SyncDecision
sync_direction = obj_diff_batch.sync_direction
if sync_direction is None:
Expand Down Expand Up @@ -226,9 +226,8 @@ def handle_sync_batch(
src_resolved_state.add_sync_instruction(sync_instruction)
# Apply empty state to source side to signal that we are done syncing
# We also add permissions for users from the low side to mark L0 request as approved
return tgt_client.apply_state(tgt_resolved_state), src_client.apply_state(
src_resolved_state
)
src_client.apply_state(src_resolved_state)
return tgt_client.apply_state(tgt_resolved_state)


def handle_ignore_batch(
Expand Down
12 changes: 5 additions & 7 deletions packages/syft/src/syft/service/sync/resolve_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,7 @@ def deny_and_ignore(self, reason: str) -> None:
assert request is not None # nosec: B101
request.deny(reason)

def click_sync(
self, *args: list, **kwargs: dict
) -> tuple[SyftSuccess, SyftSuccess]:
def click_sync(self, *args: list, **kwargs: dict) -> SyftSuccess:
# relative
from ...client.syncing import handle_sync_batch

Expand All @@ -501,16 +499,16 @@ def click_sync(
public_message="The changes in this widget have already been synced."
)

res1, res2 = handle_sync_batch(
res = handle_sync_batch(
obj_diff_batch=self.obj_diff_batch,
share_private_data=self.get_share_private_data_state(),
mockify=self.get_mockify_state(),
)

self.set_widget_result_state(res1)
self.set_widget_result_state(res)
if self.on_sync_callback:
self.on_sync_callback()
return res1, res2
return res

@property
def batch_diff_widgets(self) -> list[CollapsableObjectDiffWidget]:
Expand Down Expand Up @@ -832,7 +830,7 @@ def on_paginate(self, index: int) -> None:
def build(self) -> widgets.VBox:
return widgets.VBox([self.table_output, self.paginated_widget.build()])

def click_sync(self, index: int) -> tuple[SyftSuccess, SyftSuccess]:
def click_sync(self, index: int) -> SyftSuccess:
return self.resolve_widgets[index].click_sync()

def click_share_all_private_data(self, index: int) -> None:
Expand Down

0 comments on commit 06a356a

Please sign in to comment.