Fix return value type of dumpd (#20123)

The return type of `json.loads` is `Any`.

In fact, the return type of `dumpd` must be based on `json.loads`, so
the correction here is understandable.

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
This commit is contained in:
ChrisDEV 2024-06-20 18:31:41 +02:00 committed by GitHub
parent 0bce28cd30
commit cb6cf4b631
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,5 @@
import json import json
from typing import Any, Dict from typing import Any
from langchain_core.load.serializable import Serializable, to_json_not_implemented from langchain_core.load.serializable import Serializable, to_json_not_implemented
@ -41,7 +41,7 @@ def dumps(obj: Any, *, pretty: bool = False, **kwargs: Any) -> str:
return json.dumps(to_json_not_implemented(obj), **kwargs) return json.dumps(to_json_not_implemented(obj), **kwargs)
def dumpd(obj: Any) -> Dict[str, Any]: def dumpd(obj: Any) -> Any:
"""Return a dict representation of an object. """Return a dict representation of an object.
Note: Note: