def spanner_save_pets()

in courses/understanding_spanner/cloud-functions/spanner_save_pets/main.py [0:0]


def spanner_save_pets(event, context):
    pubsub_message = base64.b64decode(event['data']).decode('utf-8')
    data = json.loads(pubsub_message)

    # Check to see if the Owner already exists
    with database.snapshot() as snapshot:
        results = snapshot.execute_sql("""