Skip to content

Commit

Permalink
Merge pull request #3 from Shopify/ensure-default-value-for-infer-sch…
Browse files Browse the repository at this point in the history
…ema-setting

Ensure we have a default value for the infer_schema setting
  • Loading branch information
catherineemond authored Nov 15, 2023
2 parents ff968fc + af1f968 commit b5123ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tap_sftp/singer_encodings/json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def generate_schema(samples, table_spec):

schema = {}
for key, value in type_summary.items():
datatype = pick_datatype(value) if table_spec['infer_schema'] else 'string'
datatype = pick_datatype(value) if table_spec.get('infer_schema', True) else 'string'

if datatype == 'date-time':
schema[key] = {
Expand Down
3 changes: 2 additions & 1 deletion tap_sftp/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def sync_file(sftp_file_spec, stream, table_spec, config, sftp_client):
'file_name': sftp_file_spec['filepath'],
'encoding': table_spec.get('encoding', 'utf-8'),
'sanitize_header': table_spec.get('sanitize_header', False),
'skip_rows': table_spec.get('skip_rows', False)}
'skip_rows': table_spec.get('skip_rows', False),
'infer_schema': table_spec.get('infer_schema', True)}

csv_data = file_handle
if file_handle.name.endswith('.xml'):
Expand Down

0 comments on commit b5123ca

Please sign in to comment.