From f827a090b36a03cedbe3538e1dd2726dd2ba4a77 Mon Sep 17 00:00:00 2001 From: Hassan Syyid Date: Mon, 24 May 2021 21:57:57 -0400 Subject: [PATCH] Handle malformed entries in P&L --- .gitignore | 1 + setup.py | 2 +- .../quickbooks/reportstreams/ProfitAndLossDetailReport.py | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2bfa6a4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +tests/ diff --git a/setup.py b/setup.py index 073bed1..1127e1b 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def get_version(): readme = f.read() setup(name='tap-quickbooks', - version='1.4.34', + version='1.4.35', description='Singer.io tap for extracting data from the Quickbooks API', author='hotglue', url='http://hotglue.xyz/', diff --git a/tap_quickbooks/quickbooks/reportstreams/ProfitAndLossDetailReport.py b/tap_quickbooks/quickbooks/reportstreams/ProfitAndLossDetailReport.py index efe0aa6..2d50282 100644 --- a/tap_quickbooks/quickbooks/reportstreams/ProfitAndLossDetailReport.py +++ b/tap_quickbooks/quickbooks/reportstreams/ProfitAndLossDetailReport.py @@ -86,6 +86,10 @@ def sync(self, catalog_entry): # Zip columns and row data. for raw_row in output: row = dict(zip(columns, raw_row)) + if not row.get("Amount"): + # If a row is missing the amount, skip it + continue + cleansed_row = {} for k, v in row.items(): if v == "": @@ -133,6 +137,10 @@ def sync(self, catalog_entry): # Zip columns and row data. for raw_row in output: row = dict(zip(columns, raw_row)) + if not row.get("Amount"): + # If a row is missing the amount, skip it + continue + cleansed_row = {} for k, v in row.items(): if v == "":