Skip to content

Commit

Permalink
Fix return value type of dumpd (#20123)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
XinyueZ and hwchase17 authored Jun 20, 2024
1 parent 0bce28c commit cb6cf4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/core/langchain_core/load/dump.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from typing import Any, Dict
from typing import Any

from langchain_core.load.serializable import Serializable, to_json_not_implemented

Expand Down Expand Up @@ -41,7 +41,7 @@ def dumps(obj: Any, *, pretty: bool = False, **kwargs: Any) -> str:
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.
Note:
Expand Down

0 comments on commit cb6cf4b

Please sign in to comment.