Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Dec 21, 2023
1 parent 35094f6 commit 314081d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libs/langchain/langchain/output_parsers/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def parse(self, text: str) -> Dict[str, List[Any]]:

def _transform(
self, input: Iterator[Union[str, BaseMessage]]
) -> Iterator[AddableDict[str, Any]]:
) -> Iterator[AddableDict]:
parser = ET.XMLPullParser(["start", "end"])
current_path: List[str] = []
current_path_has_children = False
Expand Down Expand Up @@ -69,7 +69,7 @@ def _transform(

async def _atransform(
self, input: AsyncIterator[Union[str, BaseMessage]]
) -> AsyncIterator[AddableDict[str, Any]]:
) -> AsyncIterator[AddableDict]:
parser = ET.XMLPullParser(["start", "end"])
current_path: List[str] = []
current_path_has_children = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_xml_output_parser(result: str) -> None:

xml_result = xml_parser.parse(result)
assert DEF_RESULT_EXPECTED == xml_result
assert list(xml_parser.transform(result)) == [
assert list(xml_parser.transform(iter(result))) == [
{"foo": [{"bar": [{"baz": None}]}]},
{"foo": [{"bar": [{"baz": "slim.shady"}]}]},
{"foo": [{"baz": "tag"}]},
Expand Down

0 comments on commit 314081d

Please sign in to comment.