@@ -526,14 +526,14 @@ def load_from_dict(self, data: Dict):
526526 # Synchronization between DiffSync instances
527527 # ------------------------------------------------------------------------------
528528
529- def sync_from (
529+ def sync_from ( # pylint: disable=too-many-arguments
530530 self ,
531531 source : "DiffSync" ,
532532 diff_class : Type [Diff ] = Diff ,
533533 flags : DiffSyncFlags = DiffSyncFlags .NONE ,
534534 callback : Optional [Callable [[Text , int , int ], None ]] = None ,
535535 diff : Optional [Diff ] = None ,
536- ): # pylint: disable=too-many-arguments :
536+ ) -> Diff :
537537 """Synchronize data from the given source DiffSync object into the current DiffSync object.
538538
539539 Args:
@@ -543,6 +543,10 @@ def sync_from(
543543 callback (function): Function with parameters (stage, current, total), to be called at intervals as the
544544 calculation of the diff and subsequent sync proceed.
545545 diff (Diff): An existing diff to be used rather than generating a completely new diff.
546+ Returns:
547+ Diff: Diff between origin object and source
548+ Raises:
549+ DiffClassMismatch: The provided diff's class does not match the diff_class
546550 """
547551 if diff_class and diff :
548552 if not isinstance (diff , diff_class ):
@@ -558,14 +562,16 @@ def sync_from(
558562 if result :
559563 self .sync_complete (source , diff , flags , syncer .base_logger )
560564
561- def sync_to (
565+ return diff
566+
567+ def sync_to ( # pylint: disable=too-many-arguments
562568 self ,
563569 target : "DiffSync" ,
564570 diff_class : Type [Diff ] = Diff ,
565571 flags : DiffSyncFlags = DiffSyncFlags .NONE ,
566572 callback : Optional [Callable [[Text , int , int ], None ]] = None ,
567573 diff : Optional [Diff ] = None ,
568- ): # pylint: disable=too-many-arguments
574+ ) -> Diff :
569575 """Synchronize data from the current DiffSync object into the given target DiffSync object.
570576
571577 Args:
@@ -575,8 +581,12 @@ def sync_to(
575581 callback (function): Function with parameters (stage, current, total), to be called at intervals as the
576582 calculation of the diff and subsequent sync proceed.
577583 diff (Diff): An existing diff that will be used when determining what needs to be synced.
584+ Returns:
585+ Diff: Diff between origin object and target
586+ Raises:
587+ DiffClassMismatch: The provided diff's class does not match the diff_class
578588 """
579- target .sync_from (self , diff_class = diff_class , flags = flags , callback = callback , diff = diff )
589+ return target .sync_from (self , diff_class = diff_class , flags = flags , callback = callback , diff = diff )
580590
581591 def sync_complete (
582592 self ,
0 commit comments