This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import datetime | |
import io | |
import random | |
import string | |
from google.api_core import exceptions | |
from google.cloud.storage import Client | |
BUCKET_NAME = "gcp-storage-repro-462" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import requests | |
from google.api_core import exceptions | |
from google.cloud import storage | |
BUCKET_NAME = 'repro-gcp-9163' | |
BLOB_NAME = 'test.txt' | |
PAYLOAD = b"DEADBEEF" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from google.cloud.firestore_v1 import Client | |
def cleanup(coll): | |
for doc in coll.list_documents(): | |
print("Removing: {}".format(doc.path)) | |
doc.delete() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description: "update: nested ServerTimestamp field via dotted names" | |
update: < | |
doc_ref_path: "projects/projectID/databases/(default)/documents/C/d" | |
json_data: "{\"a.b\": 1, \"a.c\": \"ServerTimestamp\"}" | |
request: < | |
database: "projects/projectID/databases/(default)" | |
writes: < | |
update: < | |
name: "projects/projectID/databases/(default)/documents/C/d" | |
fields: < |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import threading | |
from google.cloud.storage import Client | |
PAYLOAD = b'DEADBEEF' * 100000 | |
def reader(in_file): | |
count = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pprint | |
from google.oauth2 import service_account | |
from google.cloud import firestore_v1beta1 | |
def prepare_document(client): | |
document = client.collection('test').document() | |
document.set({ | |
"foo":{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import uuid | |
from google.cloud import datastore | |
def main(): | |
ds = datastore.Client() | |
data = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# System test for 'Blob.generate_signed_url' w/ non-ASCII blob name. | |
def test_create_signed_read_url_w_non_ascii_name(self): | |
blob = self.bucket.blob(u'Caf\xe9.txt') | |
payload = b'Test signed URL for blob w/ non-ASCII name' | |
blob.upload_from_string(payload) | |
self.case_blobs_to_delete.append(blob) | |
expiration = int(time.time() + 10) | |
signed_url = blob.generate_signed_url(expiration, method='GET', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
from google.cloud import storage | |
BUCKET_NAME = 'gcp-5254-repro' | |
FILE_NAME = 'dataset/VIDEO-2018-06-06-12-26-54.mp4' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pprint | |
from google.api_core import exceptions | |
from google.cloud import bigquery | |
def setup_dataset(client): | |
ds_ref = client.dataset('gcp_5539') | |
try: | |
return client.get_dataset(ds_ref) |
NewerOlder