diff options
-rw-r--r-- | tap_google_sheets/schema.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/tap_google_sheets/schema.py b/tap_google_sheets/schema.py index 56d2fb9..fe11844 100644 --- a/tap_google_sheets/schema.py +++ b/tap_google_sheets/schema.py | |||
@@ -279,24 +279,24 @@ def get_schemas(client, spreadsheet_id): | |||
279 | spreadsheet_id=spreadsheet_id, | 279 | spreadsheet_id=spreadsheet_id, |
280 | params=params) | 280 | params=params) |
281 | 281 | ||
282 | sheets = spreadsheet_md_results.get('sheets') | 282 | sheets = spreadsheet_md_results.get('sheets', []) |
283 | if sheets: | 283 | |
284 | # Loop thru each worksheet in spreadsheet | 284 | # Loop thru each worksheet in spreadsheet |
285 | for sheet in sheets: | 285 | for sheet in sheets: |
286 | # GET sheet_json_schema for each worksheet (from function above) | 286 | # GET sheet_json_schema for each worksheet (from function above) |
287 | sheet_json_schema, columns = get_sheet_metadata(sheet, spreadsheet_id, client) | 287 | sheet_json_schema, columns = get_sheet_metadata(sheet, spreadsheet_id, client) |
288 | 288 | ||
289 | # SKIP empty sheets (where sheet_json_schema and columns are None) | 289 | # SKIP empty sheets (where sheet_json_schema and columns are None) |
290 | if sheet_json_schema and columns: | 290 | if sheet_json_schema and columns: |
291 | sheet_title = sheet.get('properties', {}).get('title') | 291 | sheet_title = sheet.get('properties', {}).get('title') |
292 | schemas[sheet_title] = sheet_json_schema | 292 | schemas[sheet_title] = sheet_json_schema |
293 | sheet_mdata = metadata.new() | 293 | sheet_mdata = metadata.new() |
294 | sheet_mdata = metadata.get_standard_metadata( | 294 | sheet_mdata = metadata.get_standard_metadata( |
295 | schema=sheet_json_schema, | 295 | schema=sheet_json_schema, |
296 | key_properties=['__sdc_row'], | 296 | key_properties=['__sdc_row'], |
297 | valid_replication_keys=None, | 297 | valid_replication_keys=None, |
298 | replication_method='FULL_TABLE' | 298 | replication_method='FULL_TABLE' |
299 | ) | 299 | ) |
300 | field_metadata[sheet_title] = sheet_mdata | 300 | field_metadata[sheet_title] = sheet_mdata |
301 | 301 | ||
302 | return schemas, field_metadata | 302 | return schemas, field_metadata |