From 99cae989b2567a1e663e420aa992aa5071a4d5a7 Mon Sep 17 00:00:00 2001 From: Peter Kosztolanyi Date: Thu, 4 Jul 2019 15:34:48 +0100 Subject: [PATCH 1/2] Fixed issue when row count returned NULL for views --- tap_snowflake/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tap_snowflake/__init__.py b/tap_snowflake/__init__.py index fd3c897..ab7a4ed 100644 --- a/tap_snowflake/__init__.py +++ b/tap_snowflake/__init__.py @@ -195,7 +195,8 @@ def discover_catalog(snowflake_conn, config): table_schema in table_info[table_catalog] and table_name in table_info[table_catalog][table_schema] ): - row_count = table_info[table_catalog][table_schema][table_name].get('row_count') + # Row Count of views returns NULL - Transform it to not null integer by defaults to 0 + row_count = table_info[table_catalog][table_schema][table_name].get('row_count', 0) or 0 is_view = table_info[table_catalog][table_schema][table_name]['is_view'] md_map = metadata.write(md_map, (), 'row-count', row_count) From 61ffdef3202892fa9ca7bf9e44829d5ed73a3de8 Mon Sep 17 00:00:00 2001 From: Peter Kosztolanyi Date: Thu, 4 Jul 2019 15:35:08 +0100 Subject: [PATCH 2/2] bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a82fa6f..e7ad5bf 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup setup(name='pipelinewise-tap-snowflake', - version='1.0.1', + version='1.0.2', description='Singer.io tap for extracting data from Snowflake - PipelineWise compatible', author="TransferWise", url='https://github.com/transferwise/pipelinewise-tap-postgres',