-
Notifications
You must be signed in to change notification settings - Fork 15
Automate pulling CSV using Google sheets API #85
Conversation
New dependencies added: googleapisAuthor: Google Inc. Description: Google APIs Client Library for Node.js Homepage: https://github.com/googleapis/google-api-nodejs-client#readme
|
anandaroop
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
I like how you've refactored the updating and sanitizing logic. This all looks well organized and tested. Thanks! 💯
| is_featured_artist_content: Boolean(is_featured_artist_content), | ||
| query: (artist_ids || gene_ids || tag_id || keyword) && { | ||
| artist_ids: artist_ids ? artist_ids.split(",").map(a => a.trim()) : [], | ||
| gene_ids: gene_ids ? gene_ids.split(",").map(a => a.trim()) : [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do admins always strictly enter these as id1,id2, as opposed to id1, id2 (i.e. does this need to be more lenient and split on comma + whitespace?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's what the .trim() method is for, it removes whitespace from both sides of the string after we split on ,.
|
Awesome! thanks @anandaroop |
https://artsyproduct.atlassian.net/browse/GROW-1144
We make use of the Google Sheets API to get update KAWS. The goal is enable admins to update and ingest data without engineering intervention. This is only one part of enabling this, the google sheet script needs this endpoint to post the current googlesheet id the user wants to update.
In terms of security, this script uses a JWT which only has permissions to read a particular google sheet from artsy's google account.
hokusai dev startand our docker compose config