Skip to content

Commit

Permalink
Updated schema generation to handle number format and be pipelinewise…
Browse files Browse the repository at this point in the history
… compatible: From singer-io#19
  • Loading branch information
eculicny committed Nov 16, 2020
1 parent 954c8d3 commit f978909
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions tap_google_sheets/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,15 @@ 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.
col_properties = {
'anyOf': [
{
'type': 'null'
},
{
'type': 'number',
'multipleOf': 1e-15
},
{
'type': 'string'
}
]
'type': ['null', 'number', 'string'],
'multipleOf': 1e-15
}
column_gs_type = 'numberType'
# Catch-all to deal with other types and set to string
Expand Down

0 comments on commit f978909

Please sign in to comment.