Skip to content

Commit

Permalink
int-699 Code review feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine-b-smartway committed Apr 17, 2024
1 parent 7506094 commit 8016f53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions magicparse/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def parse(self, data: Union[bytes, BytesIO]) -> Tuple[List[dict], List[dict]]:
items = []
errors = []

for item, rowErrors in self.stream_parse(data):
if(rowErrors):
errors.extend(rowErrors)
for item, row_errors in self.stream_parse(data):
if(row_errors):
errors.extend(row_errors)
else:
items.append(item)

return items, errors

def stream_parse(self, data: Union[bytes, BytesIO]) -> Iterable[Tuple[dict, dict]]:
def stream_parse(self, data: Union[bytes, BytesIO]) -> Iterable[Tuple[dict, list[dict]]]:
if isinstance(data, bytes):
stream = BytesIO(data)
else:
Expand Down

0 comments on commit 8016f53

Please sign in to comment.