tidyverse/googlesheets4

read_sheet pulls partially loaded sheet

Closed this issue · 1 comments

Hi all:

I want to read_sheet one sheet from a Google Spreadsheet that makes multiple IMPORTRANGE and VLOOKUP calls. However, read_sheet sometimes pulls the sheet while it is still "Loading..." (not completely loaded, usually just the first few rows), as below:

image

I can't include this sheet because it's confidential information. I don't have a reproducible example on hand yet, though I will try to create one today.

I'm assuming that the problem is that either IMPORTRANGE, VLOOKUP, or the combination of the two loads on Google's end too slowly and read_sheet simply reads the top few rows.

I am not aware of any facilities in the Sheets API for dealing with such a problem, but if you discover something the R package could take advantage of, I'd be happy to take a look.

In a very generic sense, Sys.sleep() is one way we can delay an operation in R. It's crude, but often that is enough to allow some remote system to "catch up" before we do something.