Skip to content

Commit

Permalink
fix: only create file if more than 1 message arrived (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgpayne authored Jan 8, 2023
1 parent d26ab2b commit c0a0b0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion target_singer_jsonl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def persist_lines(config, lines):
raise Exception(f"Unknown message type {t} in message {message}")

for stream, messages in stream_lines.items():
write_lines(config, stream, messages)
if len[messages] > 1: # don't write SCHEMA without any RECORDs
write_lines(config, stream, messages)

return state

Expand Down

0 comments on commit c0a0b0a

Please sign in to comment.