增强validator和打印区别

This commit is contained in:
strepsiades
2026-03-23 14:39:29 +08:00
parent 4c380f1157
commit 0812489f9d
13 changed files with 496 additions and 117 deletions
+16 -4
View File
@@ -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