Skip to content

Commit 26df853

Browse files
committed
Fix issue with load - end lines with a newline
1 parent 19dbd66 commit 26df853

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pypgstac/pypgstac/pypgstac.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,12 @@ async def aiter(list: T) -> AsyncGenerator[bytes, None]:
167167
f"Cannot load iterator with values of type {type(item)} (value {item})"
168168
)
169169

170-
line = "\n".join(
170+
lines = "\n".join(
171171
[item_str.rstrip().replace(r"\n", r"\\n").replace(r"\t", r"\\t")]
172-
).encode("utf-8")
172+
)
173+
encoded_lines = (lines + "\n").encode("utf-8")
173174

174-
yield line
175+
yield encoded_lines
175176

176177

177178
async def copy(iter: T, table: tables, conn: asyncpg.Connection) -> None:

0 commit comments

Comments
 (0)