From c0a0b0a4bac5c6be726fa6243c7520bf6893815a Mon Sep 17 00:00:00 2001 From: Ken Payne Date: Sun, 8 Jan 2023 11:50:27 +0000 Subject: [PATCH] fix: only create file if more than 1 message arrived (#11) --- target_singer_jsonl/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target_singer_jsonl/__init__.py b/target_singer_jsonl/__init__.py index 21638b1..a9025cb 100644 --- a/target_singer_jsonl/__init__.py +++ b/target_singer_jsonl/__init__.py @@ -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