|
18 | 18 | import sys |
19 | 19 | from inspect import isclass |
20 | 20 | from typing import ( |
| 21 | + Any, |
21 | 22 | Callable, |
22 | 23 | ClassVar, |
23 | 24 | Dict, |
24 | 25 | List, |
25 | 26 | Optional, |
| 27 | + Set, |
26 | 28 | Tuple, |
27 | 29 | Type, |
28 | 30 | Union, |
29 | | - Any, |
30 | | - Set, |
31 | 31 | ) |
32 | | -from typing_extensions import deprecated |
33 | 32 |
|
34 | | -from pydantic import ConfigDict, BaseModel, PrivateAttr |
35 | 33 | import structlog # type: ignore |
| 34 | +from pydantic import BaseModel, ConfigDict, PrivateAttr |
| 35 | +from typing_extensions import deprecated |
36 | 36 |
|
37 | 37 | from diffsync.diff import Diff |
38 | | -from diffsync.enum import DiffSyncModelFlags, DiffSyncFlags, DiffSyncStatus |
| 38 | +from diffsync.enum import DiffSyncFlags, DiffSyncModelFlags, DiffSyncStatus |
39 | 39 | from diffsync.exceptions import ( |
40 | 40 | DiffClassMismatch, |
41 | 41 | ObjectAlreadyExists, |
42 | | - ObjectStoreWrongType, |
43 | 42 | ObjectNotFound, |
| 43 | + ObjectStoreWrongType, |
44 | 44 | ) |
45 | 45 | from diffsync.helpers import DiffSyncDiffer, DiffSyncSyncer |
46 | 46 | from diffsync.store import BaseStore |
@@ -134,16 +134,16 @@ def __pydantic_init_subclass__(cls, **kwargs: Any) -> None: |
134 | 134 | """ |
135 | 135 | # Make sure that any field referenced by name actually exists on the model |
136 | 136 | for attr in cls._identifiers: |
137 | | - if attr not in cls.model_fields and not hasattr(cls, attr): |
| 137 | + if attr not in cls.model_fields and not hasattr(cls, attr): # pylint: disable=unsupported-membership-test |
138 | 138 | raise AttributeError(f"_identifiers {cls._identifiers} references missing or un-annotated attr {attr}") |
139 | 139 | for attr in cls._shortname: |
140 | | - if attr not in cls.model_fields: |
| 140 | + if attr not in cls.model_fields: # pylint: disable=unsupported-membership-test |
141 | 141 | raise AttributeError(f"_shortname {cls._shortname} references missing or un-annotated attr {attr}") |
142 | 142 | for attr in cls._attributes: |
143 | | - if attr not in cls.model_fields: |
| 143 | + if attr not in cls.model_fields: # pylint: disable=unsupported-membership-test |
144 | 144 | raise AttributeError(f"_attributes {cls._attributes} references missing or un-annotated attr {attr}") |
145 | 145 | for attr in cls._children.values(): |
146 | | - if attr not in cls.model_fields: |
| 146 | + if attr not in cls.model_fields: # pylint: disable=unsupported-membership-test |
147 | 147 | raise AttributeError(f"_children {cls._children} references missing or un-annotated attr {attr}") |
148 | 148 |
|
149 | 149 | # Any given field can only be in one of (_identifiers, _attributes, _children) |
|
0 commit comments