Question : google.api_core.exceptions.ServiceUnavailable: 503 The datastore operation timed out, or the data was temporarily unavailable when using stream
Answered by : carson-stevens-1fs8bsuvacbd
def iterate(collection_name, batch_size=5000, cursor=None): query = client.collection(collection_name).limit(batch_size).order_by('__name__') if cursor: query = query.start_after(cursor) for doc in query.stream(): yield doc if 'doc' in locals(): yield from iterate(collection_name, batch_size, doc)
Source : https://stackoverflow.com/questions/56842251/google-api-core-exceptions-serviceunavailable-503-the-datastore-operation-timed | Last Update : Mon, 04 Jul 22