Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to google-cloud #544

Merged
merged 10 commits into from
Sep 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appengine/flexible/datastore/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import socket

from flask import Flask, request
from gcloud import datastore
from google.cloud import datastore


app = Flask(__name__)
Expand Down
2 changes: 1 addition & 1 deletion appengine/flexible/datastore/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==0.11.1
gcloud==0.18.3
google-cloud-datastore==0.20.0
gunicorn==19.6.0
oauth2client==3.0.0
2 changes: 1 addition & 1 deletion appengine/flexible/django_cloudsql/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Django==1.10.1
mysqlclient==1.3.7
mysqlclient==1.3.8
wheel==0.30.0a0
gunicorn==19.6.0
2 changes: 0 additions & 2 deletions appengine/flexible/endpoints/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Flask==0.11.1
flask-cors==3.0.2
gunicorn==19.6.0
gcloud==0.18.3
six==1.10.0
pyyaml==3.12
requests==2.11.1
google-api-python-client==1.5.3
2 changes: 1 addition & 1 deletion appengine/flexible/pubsub/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import os

from flask import current_app, Flask, render_template, request
from gcloud import pubsub
from google.cloud import pubsub


app = Flask(__name__)
Expand Down
2 changes: 1 addition & 1 deletion appengine/flexible/pubsub/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==0.11.1
gcloud==0.18.3
google-cloud-pubsub==0.20.0
gunicorn==19.6.0
oauth2client==3.0.0
2 changes: 1 addition & 1 deletion appengine/flexible/storage/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import os

from flask import Flask, request
from gcloud import storage
from google.cloud import storage

# [start config]
app = Flask(__name__)
Expand Down
2 changes: 1 addition & 1 deletion appengine/flexible/storage/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==0.11.1
gcloud==0.18.3
google-cloud-storage==0.20.0
gunicorn==19.6.0
2 changes: 1 addition & 1 deletion bigquery/cloud-client/async_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import time
import uuid

from gcloud import bigquery
from google.cloud import bigquery


def async_query(query):
Expand Down
2 changes: 1 addition & 1 deletion bigquery/cloud-client/export_data_to_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import time
import uuid

from gcloud import bigquery
from google.cloud import bigquery


def export_data_to_gcs(dataset_name, table_name, destination):
Expand Down
2 changes: 1 addition & 1 deletion bigquery/cloud-client/load_data_from_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import argparse
import time
from gcloud import bigquery
from google.cloud import bigquery


def load_data_from_file(dataset_name, table_name, source_file_name):
Expand Down
2 changes: 1 addition & 1 deletion bigquery/cloud-client/load_data_from_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import time
import uuid

from gcloud import bigquery
from google.cloud import bigquery


def load_data_from_gcs(dataset_name, table_name, source):
Expand Down
2 changes: 1 addition & 1 deletion bigquery/cloud-client/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
gcloud==0.18.3
google-cloud-bigquery==0.20.0
8 changes: 4 additions & 4 deletions bigquery/cloud-client/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import time
import uuid

from gcloud import bigquery
import gcloud.bigquery.job
from google.cloud import bigquery
import google.cloud.bigquery.job


def list_projects():
Expand Down Expand Up @@ -145,7 +145,7 @@ def list_rows(dataset_name, table_name, project=None):
break

# Use format to create a simple table.
format_string = '{:<16} ' * len(table.schema)
format_string = '{!s:<16} ' * len(table.schema)

# Print schema field names
field_names = [field.name for field in table.schema]
Expand Down Expand Up @@ -177,7 +177,7 @@ def copy_table(dataset_name, table_name, new_table_name, project=None):

# Create the table if it doesn't exist.
job.create_disposition = (
gcloud.bigquery.job.CreateDisposition.CREATE_IF_NEEDED)
google.cloud.bigquery.job.CreateDisposition.CREATE_IF_NEEDED)

# Start the job.
job.begin()
Expand Down
2 changes: 1 addition & 1 deletion bigquery/cloud-client/snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from gcloud import bigquery
from google.cloud import bigquery
import pytest

import snippets
Expand Down
2 changes: 1 addition & 1 deletion bigquery/cloud-client/stream_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import json
from pprint import pprint

from gcloud import bigquery
from google.cloud import bigquery


def stream_data(dataset_name, table_name, json_data):
Expand Down
2 changes: 1 addition & 1 deletion bigquery/cloud-client/sync_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import argparse

# [START sync_query]
from gcloud import bigquery
from google.cloud import bigquery


def sync_query(query):
Expand Down
2 changes: 1 addition & 1 deletion bigquery/dml/insert_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# [START insert_sql]
import argparse

from gcloud import bigquery
from google.cloud import bigquery


def insert_sql(project, default_dataset, sql_path):
Expand Down
2 changes: 1 addition & 1 deletion bigquery/dml/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flake8==3.0.4
gcloud==0.18.3
google-cloud-bigquery==0.20.0
PyMySQL==0.7.9
six==1.10.0
SQLAlchemy==1.1.0b3
134 changes: 67 additions & 67 deletions bigtable/hello/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,79 +26,79 @@

import argparse

from gcloud import bigtable
from google.cloud import bigtable


def main(project_id, instance_id, table_id):
# [START connecting_to_bigtable]
# The client must be created with admin=True because it will create a
# table.
with bigtable.Client(project=project_id, admin=True) as client:
instance = client.instance(instance_id)
# [END connecting_to_bigtable]

# [START creating_a_table]
print('Creating the {} table.'.format(table_id))
table = instance.table(table_id)
table.create()
column_family_id = 'cf1'
cf1 = table.column_family(column_family_id)
cf1.create()
# [END creating_a_table]

# [START writing_rows]
print('Writing some greetings to the table.')
column_id = 'greeting'.encode('utf-8')
greetings = [
'Hello World!',
'Hello Cloud Bigtable!',
'Hello Python!',
]

for i, value in enumerate(greetings):
# Note: This example uses sequential numeric IDs for simplicity,
# but this can result in poor performance in a production
# application. Since rows are stored in sorted order by key,
# sequential keys can result in poor distribution of operations
# across nodes.
#
# For more information about how to design a Bigtable schema for
# the best performance, see the documentation:
#
# https://cloud.google.com/bigtable/docs/schema-design
row_key = 'greeting{}'.format(i)
row = table.row(row_key)
row.set_cell(
column_family_id,
column_id,
value.encode('utf-8'))
row.commit()
# [END writing_rows]

# [START getting_a_row]
print('Getting a single greeting by row key.')
key = 'greeting0'
row = table.read_row(key.encode('utf-8'))
value = row.cells[column_family_id][column_id][0].value
print('\t{}: {}'.format(key, value.decode('utf-8')))
# [END getting_a_row]

# [START scanning_all_rows]
print('Scanning for all greetings:')
partial_rows = table.read_rows()
partial_rows.consume_all()

for row_key, row in partial_rows.rows.items():
key = row_key.decode('utf-8')
cell = row.cells[column_family_id][column_id][0]
value = cell.value.decode('utf-8')
print('\t{}: {}'.format(key, value))
# [END scanning_all_rows]

# [START deleting_a_table]
print('Deleting the {} table.'.format(table_id))
table.delete()
# [END deleting_a_table]
client = bigtable.Client(project=project_id, admin=True)
instance = client.instance(instance_id)
# [END connecting_to_bigtable]

# [START creating_a_table]
print('Creating the {} table.'.format(table_id))
table = instance.table(table_id)
table.create()
column_family_id = 'cf1'
cf1 = table.column_family(column_family_id)
cf1.create()
# [END creating_a_table]

# [START writing_rows]
print('Writing some greetings to the table.')
column_id = 'greeting'.encode('utf-8')
greetings = [
'Hello World!',
'Hello Cloud Bigtable!',
'Hello Python!',
]

for i, value in enumerate(greetings):
# Note: This example uses sequential numeric IDs for simplicity,
# but this can result in poor performance in a production
# application. Since rows are stored in sorted order by key,
# sequential keys can result in poor distribution of operations
# across nodes.
#
# For more information about how to design a Bigtable schema for
# the best performance, see the documentation:
#
# https://cloud.google.com/bigtable/docs/schema-design
row_key = 'greeting{}'.format(i)
row = table.row(row_key)
row.set_cell(
column_family_id,
column_id,
value.encode('utf-8'))
row.commit()
# [END writing_rows]

# [START getting_a_row]
print('Getting a single greeting by row key.')
key = 'greeting0'
row = table.read_row(key.encode('utf-8'))
value = row.cells[column_family_id][column_id][0].value
print('\t{}: {}'.format(key, value.decode('utf-8')))
# [END getting_a_row]

# [START scanning_all_rows]
print('Scanning for all greetings:')
partial_rows = table.read_rows()
partial_rows.consume_all()

for row_key, row in partial_rows.rows.items():
key = row_key.decode('utf-8')
cell = row.cells[column_family_id][column_id][0]
value = cell.value.decode('utf-8')
print('\t{}: {}'.format(key, value))
# [END scanning_all_rows]

# [START deleting_a_table]
print('Deleting the {} table.'.format(table_id))
table.delete()
# [END deleting_a_table]


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion bigtable/hello/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
gcloud[grpc]==0.18.3
google-cloud-bigtable==0.20.0
4 changes: 2 additions & 2 deletions bigtable/hello_happybase/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

import argparse

from gcloud import bigtable
from gcloud.bigtable import happybase
from google.cloud import bigtable
from google.cloud import happybase


def main(project_id, instance_id, table_name):
Expand Down
2 changes: 1 addition & 1 deletion bigtable/hello_happybase/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
gcloud[grpc]==0.18.3
google-cloud-happybase==0.20.0
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import argparse
import datetime

from gcloud import datastore
from google.cloud import datastore


def path_to_key(datastore, path):
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
gcloud==0.18.3
google-cloud-datastore==0.20.0
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import argparse
import datetime

from gcloud import datastore
from google.cloud import datastore


def path_to_key(datastore, path):
Expand Down
2 changes: 1 addition & 1 deletion container_engine/django_tutorial/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Django==1.10.1
mysqlclient==1.3.7
mysqlclient==1.3.8
wheel==0.30.0a0
gunicorn==19.6.0
2 changes: 1 addition & 1 deletion dataproc/create_cluster_and_submit_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import os

from apiclient import discovery
from gcloud import storage
from google.cloud import storage
from oauth2client.client import GoogleCredentials

# Currently only the "global" region is supported
Expand Down
2 changes: 1 addition & 1 deletion dataproc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
google-api-python-client==1.5.3
gcloud==0.18.3
google-cloud==0.20.0
2 changes: 1 addition & 1 deletion datastore/api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
gcloud==0.18.3
google-cloud-datastore==0.20.0
Loading