Fully reimplement format-dict validation:
- better readability - better error messages (wrong keys grouped by error type) - added `_cleanup_format_dict()`
This commit is contained in:
+4
-4
@@ -9,13 +9,13 @@ from .__meta import (
|
||||
category as _category,
|
||||
pack_id_suffix as _pack_id
|
||||
)
|
||||
from .__typing import _A, _U, _O, _t, T as _T, FormatDict as _FormatDict
|
||||
from ._validate_funcs import _verify_input_dict
|
||||
from .__typing import _A, _U, _O, _t, T as _T, DictMap as _DictMap
|
||||
from ._io_custom import (
|
||||
_BaseNode,
|
||||
_DICT_INPUT_OPTIONAL, _DICT_OUTPUT,
|
||||
_schema_old_name
|
||||
)
|
||||
from ._validate_funcs import _verify_format_dict
|
||||
from .docstring_formatter import format_docstring as _format_docstring
|
||||
|
||||
# ----------------------------------------------------------
|
||||
@@ -37,7 +37,7 @@ class ValidateKeys(_BaseNode):
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, dict: _O[_FormatDict] = None) -> _io.NodeOutput:
|
||||
def execute(cls, dict: _O[_DictMap] = None) -> _io.NodeOutput:
|
||||
# try:
|
||||
# _verify_input_dict(dict, error_if_none=True)
|
||||
# except Exception:
|
||||
@@ -45,7 +45,7 @@ class ValidateKeys(_BaseNode):
|
||||
# raise
|
||||
# return (Null, )
|
||||
# _show_text_on_node('✅', unique_id)
|
||||
_verify_input_dict(dict, error_if_none=True)
|
||||
_verify_format_dict(dict, error_if_none=True)
|
||||
return _io.NodeOutput(dict)
|
||||
|
||||
# ==========================================================
|
||||
|
||||
Reference in New Issue
Block a user