From 65e41840a219efbb3d6ac0b59c431135d8c6ef32 Mon Sep 17 00:00:00 2001 From: Henri Blancke Date: Mon, 31 Aug 2020 10:45:27 -0400 Subject: [PATCH 1/3] [UPD] support direct number type --- tap_google_sheets/schema.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tap_google_sheets/schema.py b/tap_google_sheets/schema.py index fcaccf9..dc2841e 100644 --- a/tap_google_sheets/schema.py +++ b/tap_google_sheets/schema.py @@ -149,6 +149,9 @@ def get_sheet_schema_columns(sheet): elif column_number_format_type == 'TEXT': col_properties = {'type': ['null', 'string']} column_gs_type = 'stringValue' + elif column_number_format_type == 'NUMBER': + col_properties = {'type': ['null', 'number']} + column_gs_type = 'numberType' else: # Interesting - order in the anyOf makes a difference. # Number w/ multipleOf must be listed last, otherwise errors occur. From 93b819d3f54a20c1c541bc270a51481823a0ffff Mon Sep 17 00:00:00 2001 From: Henri Blancke Date: Mon, 31 Aug 2020 10:46:04 -0400 Subject: [PATCH 2/3] [UPD] multiple types new json schema specs --- tap_google_sheets/schema.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/tap_google_sheets/schema.py b/tap_google_sheets/schema.py index dc2841e..ad2083c 100644 --- a/tap_google_sheets/schema.py +++ b/tap_google_sheets/schema.py @@ -155,20 +155,7 @@ def get_sheet_schema_columns(sheet): else: # Interesting - order in the anyOf makes a difference. # Number w/ multipleOf must be listed last, otherwise errors occur. - col_properties = { - 'anyOf': [ - { - 'type': 'null' - }, - { - 'type': 'number', - 'multipleOf': 1e-15 - }, - { - 'type': 'string' - } - ] - } + col_properties = {'type': ['null', 'number', 'string']} column_gs_type = 'numberType' # Catch-all to deal with other types and set to string # column_effective_value_type: formulaValue, errorValue, or other From b3e79cd3bbb8a7b0f9eed6dd288a0c521a5395b2 Mon Sep 17 00:00:00 2001 From: Henri Blancke Date: Mon, 31 Aug 2020 10:52:39 -0400 Subject: [PATCH 3/3] [UPD] Add back multipleOf --- tap_google_sheets/schema.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tap_google_sheets/schema.py b/tap_google_sheets/schema.py index ad2083c..5b1aff7 100644 --- a/tap_google_sheets/schema.py +++ b/tap_google_sheets/schema.py @@ -155,7 +155,10 @@ def get_sheet_schema_columns(sheet): else: # Interesting - order in the anyOf makes a difference. # Number w/ multipleOf must be listed last, otherwise errors occur. - col_properties = {'type': ['null', 'number', 'string']} + col_properties = { + 'type': ['null', 'number', 'string'], + 'multipleOf': 1e-15 + } column_gs_type = 'numberType' # Catch-all to deal with other types and set to string # column_effective_value_type: formulaValue, errorValue, or other