Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

google.api_core.exceptions.ServiceUnavailable: 503 The datastore operation timed out, or the data was temporarily unavailable when using stream

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 by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #The #datastore #operation #timed #data #temporarily #unavailable #stream
ADD COMMENT
Topic
Name
9+4 =