From 52b2f7fbb4a4ab8a63c9983b6bdf403d54ff0ab5 Mon Sep 17 00:00:00 2001 From: Hassan Syyid Date: Thu, 20 May 2021 13:08:06 -0400 Subject: [PATCH] Handle missing entries in fixed_headers --- setup.py | 2 +- target_csv.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 3ec6760..3652235 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup setup(name='target-csv', - version='0.3.2', + version='0.3.3', description='Singer.io target for writing CSV files', author='Stitch', url='https://singer.io', diff --git a/target_csv.py b/target_csv.py index f732735..71a38a9 100755 --- a/target_csv.py +++ b/target_csv.py @@ -68,7 +68,7 @@ def persist_messages(delimiter, quotechar, messages, destination_path, fixed_hea # flattened_record = flatten(o['record']) flattened_record = o['record'] - if fixed_headers is not None: + if fixed_headers is not None and o['stream'] in fixed_headers: if o['stream'] not in headers: headers[o['stream']] = fixed_headers[o['stream']] else: