增强validator和打印区别
This commit is contained in:
@@ -337,11 +337,11 @@ class BaseNodeHandler(ABC, Generic[T]):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
node_type: str,
|
||||
node_class: Type["SyncNode[T]"],
|
||||
schema: Type[T]
|
||||
node_type: str | None = None,
|
||||
node_class: Type["SyncNode[T]"] | None = None,
|
||||
schema: Type[T] | None = None,
|
||||
):
|
||||
self._node_type = node_type
|
||||
self._node_type = node_type or ""
|
||||
self._node_class = node_class
|
||||
self._schema = schema
|
||||
self._collection: Optional["DataCollection"] = None
|
||||
@@ -368,6 +368,18 @@ class BaseNodeHandler(ABC, Generic[T]):
|
||||
return [str(item) for item in value if str(item)]
|
||||
return []
|
||||
|
||||
def should_skip_by_data_id_filter(self, item: Dict[str, Any], item_id: str) -> bool:
|
||||
data_id_filter = set(self.get_data_id_filter())
|
||||
if not data_id_filter:
|
||||
return False
|
||||
if self.node_type == "project":
|
||||
return item_id not in data_id_filter
|
||||
|
||||
project_id = item.get("project_id")
|
||||
if project_id:
|
||||
return str(project_id) not in data_id_filter
|
||||
return False
|
||||
|
||||
def set_api_client(self, client: "ApiClient") -> None:
|
||||
"""默认忽略 API 客户端注入。"""
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user