aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPaul B <paul@bonaud.fr>2020-11-23 10:06:09 +0100
committerPaul B <paul@bonaud.fr>2020-11-23 10:06:09 +0100
commitef3fa542f83b5e12b999224aaa86c46bf328b24f (patch)
treed5929eef4460fbd75566fd3135c39a27da3cc5a4
parent4bf194076d39d516c3cd0f5c3559954ebe8a12f2 (diff)
downloadtap-google-sheets-use-google-api-client.tar.gz
tap-google-sheets-use-google-api-client.tar.zst
tap-google-sheets-use-google-api-client.zip
cleanup: remove useless use of if conditionuse-google-api-client
-rw-r--r--tap_google_sheets/schema.py38
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