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', 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)