Skip to content

Commit

Permalink
CDK: apply coderabbit suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Inzhyyants <artem.inzhyyants@gmail.com>
  • Loading branch information
artem1205 committed Dec 26, 2024
1 parent 2ff8edf commit 9641d4d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def parse(
"""
Decompress gzipped bytes and pass decompressed data to the inner parser.
"""
gzipobj = gzip.GzipFile(fileobj=data, mode="rb")
yield from self.inner_parser.parse(gzipobj)
with gzip.GzipFile(fileobj=data, mode="rb") as gzipobj:
yield from self.inner_parser.parse(gzipobj)


@dataclass
Expand All @@ -54,7 +54,7 @@ def parse(
try:
yield json.loads(line.decode(encoding=self.encoding or "utf-8"))
except json.JSONDecodeError:
logger.warning(f"Cannot decode/parse line {line!r} as JSON")
logger.warning(f"Cannot decode/parse line {line!r} as JSON, error: {e}")


@dataclass
Expand Down

0 comments on commit 9641d4d

Please sign in to comment.