1414See the License for the specific language governing permissions and
1515limitations under the License.
1616"""
17+ # pylint: disable=too-many-lines
1718
1819import sys
1920from copy import deepcopy
5859StrType = str
5960
6061
61- class DiffSyncModel (BaseModel ):
62+ class DiffSyncModel (BaseModel ): # pylint: disable=too-many-public-methods
6263 """Base class for all DiffSync object models.
6364
6465 Note that read-only APIs of this class are implemented as `get_*()` methods rather than as properties;
@@ -322,7 +323,7 @@ def create_bulk(cls, adapter: "Adapter", objects: List[Dict]) -> List[Optional[S
322323 return [cls .create (adapter = adapter , ids = obj ["ids" ], attrs = obj ["attrs" ]) for obj in objects ]
323324
324325 @classmethod
325- def update_bulk (cls , adapter : "Adapter" , objects : List [Tuple ["DiffSyncModel" , Dict ]]) -> List [Optional [Self ]]:
326+ def update_bulk (cls , adapter : "Adapter" , objects : List [Tuple ["DiffSyncModel" , Dict ]]) -> List [Optional [Self ]]: # noqa: ARG003
326327 """Bulk update multiple instances. Override for batch updates (e.g. single API call).
327328
328329 The default implementation loops over individual update() calls.
@@ -337,7 +338,7 @@ def update_bulk(cls, adapter: "Adapter", objects: List[Tuple["DiffSyncModel", Di
337338 return [model .update (attrs = attrs ) for model , attrs in objects ]
338339
339340 @classmethod
340- def delete_bulk (cls , adapter : "Adapter" , objects : List ["DiffSyncModel" ]) -> List [Optional [Self ]]:
341+ def delete_bulk (cls , adapter : "Adapter" , objects : List ["DiffSyncModel" ]) -> List [Optional [Self ]]: # noqa: ARG003
341342 """Bulk delete multiple instances. Override for batch deletion (e.g. single API call).
342343
343344 The default implementation loops over individual delete() calls.
@@ -533,7 +534,7 @@ def __new__(cls, **kwargs): # type: ignore[no-untyped-def]
533534 for key , value in kwargs .items ():
534535 try :
535536 meta_kwargs [key ] = deepcopy (value )
536- except Exception : # pylint: disable=broad-exception-caught
537+ except Exception : # pylint: disable=broad-except
537538 # Some objects (e.g. Kafka Consumer, DB connections) cannot be deep copied
538539 meta_kwargs [key ] = value
539540 instance = super ().__new__ (cls )
@@ -619,7 +620,7 @@ def load_from_dict(self, data: Dict) -> None:
619620 # Synchronization between DiffSync instances
620621 # ------------------------------------------------------------------------------
621622
622- def sync_from ( # pylint: disable=too-many-arguments, too-many-positional-arguments
623+ def sync_from ( # pylint: disable=too-many-arguments,R0917, too-many-locals
623624 self ,
624625 source : "Adapter" ,
625626 diff_class : Type [Diff ] = Diff ,
@@ -698,7 +699,7 @@ def sync_from( # pylint: disable=too-many-arguments, too-many-positional-argume
698699
699700 return diff
700701
701- def sync_to ( # pylint: disable=too-many-arguments, too-many-positional-arguments
702+ def sync_to ( # pylint: disable=too-many-arguments,R0917
702703 self ,
703704 target : "Adapter" ,
704705 diff_class : Type [Diff ] = Diff ,
@@ -753,7 +754,7 @@ def sync_to( # pylint: disable=too-many-arguments, too-many-positional-argument
753754 max_workers = max_workers ,
754755 )
755756
756- def sync_complete (
757+ def sync_complete ( # pylint: disable=too-many-arguments,R0917
757758 self ,
758759 source : "Adapter" ,
759760 diff : Diff ,
@@ -782,7 +783,7 @@ def sync_complete(
782783 # Diff calculation and construction
783784 # ------------------------------------------------------------------------------
784785
785- def diff_from ( # pylint: disable=too-many-arguments, too-many-positional-arguments
786+ def diff_from ( # pylint: disable=too-many-arguments,R0917
786787 self ,
787788 source : "Adapter" ,
788789 diff_class : Type [Diff ] = Diff ,
@@ -819,7 +820,7 @@ def diff_from( # pylint: disable=too-many-arguments, too-many-positional-argume
819820 )
820821 return differ .calculate_diffs ()
821822
822- def diff_to ( # pylint: disable=too-many-arguments, too-many-positional-arguments
823+ def diff_to ( # pylint: disable=too-many-arguments,R0917
823824 self ,
824825 target : "Adapter" ,
825826 diff_class : Type [Diff ] = Diff ,
0 commit comments