diff options
author | Jeff Huth <39202799+jeffhuth-bytecode@users.noreply.github.com> | 2019-12-04 06:10:46 -0800 |
---|---|---|
committer | Kyle Allan <KAllan357@gmail.com> | 2019-12-04 09:10:46 -0500 |
commit | 5890b89c1aa7c554235b3cef156b5a5a2c594bec (patch) | |
tree | 2f553cda853991aedb1cec68dc6d06b87d6fe190 /tap_google_sheets/streams.py | |
parent | 075af7096d3c1b369702feba4076c25b954732dc (diff) | |
download | tap-google-sheets-8b2afddb15d10a6727c50c9c6feaeff6060b114e.tar.gz tap-google-sheets-8b2afddb15d10a6727c50c9c6feaeff6060b114e.tar.zst tap-google-sheets-8b2afddb15d10a6727c50c9c6feaeff6060b114e.zip |
v.0.0.2 schema and sync changes (#1)v0.0.2
Change number json schema to anyOf with multipleOf; skip empty rows; move write_bookmark to end of sync.py
Diffstat (limited to 'tap_google_sheets/streams.py')
-rw-r--r-- | tap_google_sheets/streams.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tap_google_sheets/streams.py b/tap_google_sheets/streams.py index b8e3eff..ad5529f 100644 --- a/tap_google_sheets/streams.py +++ b/tap_google_sheets/streams.py | |||
@@ -13,6 +13,8 @@ from collections import OrderedDict | |||
13 | # data_key: JSON element containing the results list for the endpoint; | 13 | # data_key: JSON element containing the results list for the endpoint; |
14 | # default = root (no data_key) | 14 | # default = root (no data_key) |
15 | 15 | ||
16 | # file_metadata: Queries Google Drive API to get file information and see if file has been modified | ||
17 | # Provides audit info about who and when last changed the file. | ||
16 | FILE_METADATA = { | 18 | FILE_METADATA = { |
17 | "api": "files", | 19 | "api": "files", |
18 | "path": "files/{spreadsheet_id}", | 20 | "path": "files/{spreadsheet_id}", |
@@ -24,6 +26,7 @@ FILE_METADATA = { | |||
24 | } | 26 | } |
25 | } | 27 | } |
26 | 28 | ||
29 | # spreadsheet_metadata: Queries spreadsheet to get basic information on spreadhsheet and sheets | ||
27 | SPREADSHEET_METADATA = { | 30 | SPREADSHEET_METADATA = { |
28 | "api": "sheets", | 31 | "api": "sheets", |
29 | "path": "spreadsheets/{spreadsheet_id}", | 32 | "path": "spreadsheets/{spreadsheet_id}", |
@@ -34,6 +37,9 @@ SPREADSHEET_METADATA = { | |||
34 | } | 37 | } |
35 | } | 38 | } |
36 | 39 | ||
40 | # sheet_metadata: Get Header Row and 1st data row (Rows 1 & 2) from a Sheet on Spreadsheet. | ||
41 | # This endpoint includes detailed metadata about each cell in the header and first data row | ||
42 | # incl. data type, formatting, etc. | ||
37 | SHEET_METADATA = { | 43 | SHEET_METADATA = { |
38 | "api": "sheets", | 44 | "api": "sheets", |
39 | "path": "spreadsheets/{spreadsheet_id}", | 45 | "path": "spreadsheets/{spreadsheet_id}", |
@@ -45,6 +51,8 @@ SHEET_METADATA = { | |||
45 | } | 51 | } |
46 | } | 52 | } |
47 | 53 | ||
54 | # sheets_loaded: Queries a batch of Rows for each Sheet in the Spreadsheet. | ||
55 | # Each query uses the `values` endpoint, to get data-only, w/out the formatting/type metadata. | ||
48 | SHEETS_LOADED = { | 56 | SHEETS_LOADED = { |
49 | "api": "sheets", | 57 | "api": "sheets", |
50 | "path": "spreadsheets/{spreadsheet_id}/values/'{sheet_title}'!{range_rows}", | 58 | "path": "spreadsheets/{spreadsheet_id}/values/'{sheet_title}'!{range_rows}", |
@@ -58,7 +66,7 @@ SHEETS_LOADED = { | |||
58 | } | 66 | } |
59 | } | 67 | } |
60 | 68 | ||
61 | # Ensure streams are ordered logically | 69 | # Ensure streams are ordered sequentially, logically. |
62 | STREAMS = OrderedDict() | 70 | STREAMS = OrderedDict() |
63 | STREAMS['file_metadata'] = FILE_METADATA | 71 | STREAMS['file_metadata'] = FILE_METADATA |
64 | STREAMS['spreadsheet_metadata'] = SPREADSHEET_METADATA | 72 | STREAMS['spreadsheet_metadata'] = SPREADSHEET_METADATA |