Skip to content

Commit 1341a4f

Browse files
committed
Fix styling using flake8
1 parent cb6402d commit 1341a4f

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

samples/samples/graph_snippets.py

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,8 @@
2121
"""
2222

2323
import argparse
24-
import base64
25-
import datetime
26-
import decimal
27-
import json
28-
import logging
29-
import time
3024

3125
from google.cloud import spanner
32-
from google.cloud.spanner_admin_instance_v1.types import spanner_instance_admin
33-
from google.cloud.spanner_v1 import DirectedReadOptions, param_types
34-
from google.cloud.spanner_v1.data_types import JsonObject
35-
from google.protobuf import field_mask_pb2 # type: ignore
36-
from testdata import singer_pb2
3726

3827
OPERATION_TIMEOUT_SECONDS = 240
3928

@@ -54,7 +43,6 @@ def create_database_with_property_graph(instance_id, database_id):
5443
"""CREATE TABLE Person (
5544
id INT64 NOT NULL,
5645
name STRING(MAX),
57-
gender STRING(40),
5846
birthday TIMESTAMP,
5947
country STRING(MAX),
6048
city STRING(MAX),
@@ -167,11 +155,11 @@ def insert_data(instance_id, database_id):
167155

168156
batch.insert(
169157
table="Person",
170-
columns=("id", "name", "gender", "birthday", "country", "city"),
158+
columns=("id", "name", "birthday", "country", "city"),
171159
values=[
172-
(1, "Alex", "male", '1991-12-21T00:00:00.12Z', "Australia"," Adelaide"),
173-
(2, "Dana", "female", '1980-10-31T00:00:00.12Z',"Czech_Republic", "Moravia"),
174-
(3, "Lee", "male", '1986-12-07T00:00:00.12Z', "India", "Kollam")
160+
(1, "Alex", '1991-12-21T00:00:00.12Z', "Australia"," Adelaide"),
161+
(2, "Dana", '1980-10-31T00:00:00.12Z',"Czech_Republic", "Moravia"),
162+
(3, "Lee", '1986-12-07T00:00:00.12Z', "India", "Kollam")
175163
],
176164
)
177165

@@ -206,7 +194,7 @@ def insert_data(instance_id, database_id):
206194
# [START spanner_insert_graph_data_with_dml]
207195
def insert_data_with_dml(instance_id, database_id):
208196
"""Inserts sample data into the given database using a DML statement."""
209-
197+
210198
# instance_id = "your-spanner-instance"
211199
# database_id = "your-spanner-db-id"
212200

@@ -234,7 +222,6 @@ def insert_transfers(transaction):
234222

235223
print("{} record(s) inserted into AccountTransferAccount.".format(row_ct))
236224

237-
238225
database.run_in_transaction(insert_accounts)
239226
database.run_in_transaction(insert_transfers)
240227

@@ -324,7 +311,7 @@ def query_data(instance_id, database_id):
324311
# [START spanner_with_graph_query_data_with_parameter]
325312
def query_data_with_parameter(instance_id, database_id):
326313
"""Queries sample data from the database using SQL with a parameter."""
327-
314+
328315
# instance_id = "your-spanner-instance"
329316
# database_id = "your-spanner-db-id"
330317
spanner_client = spanner.Client()
@@ -351,7 +338,7 @@ def query_data_with_parameter(instance_id, database_id):
351338
# [START spanner_delete_graph_data_with_dml]
352339
def delete_data_with_dml(instance_id, database_id):
353340
"""Deletes sample data from the database using a DML statement."""
354-
341+
355342
# instance_id = "your-spanner-instance"
356343
# database_id = "your-spanner-db-id"
357344

@@ -430,12 +417,12 @@ def delete_data(instance_id, database_id):
430417
"create_database_with_property_graph",
431418
help=create_database_with_property_graph.__doc__)
432419
subparsers.add_parser("update_allow_commit_timestamps",
433-
help=update_allow_commit_timestamps.__doc__)
420+
help=update_allow_commit_timestamps.__doc__)
434421
subparsers.add_parser("insert_data", help=insert_data.__doc__)
435422
subparsers.add_parser("insert_data_with_dml", help=insert_data_with_dml.__doc__)
436423
subparsers.add_parser("update_data_with_dml", help=update_data_with_dml.__doc__)
437424
subparsers.add_parser("update_data_with_graph_query_in_dml",
438-
help=update_data_with_graph_query_in_dml.__doc__)
425+
help=update_data_with_graph_query_in_dml.__doc__)
439426
subparsers.add_parser("query_data", help=query_data.__doc__)
440427
subparsers.add_parser(
441428
"query_data_with_parameter", help=query_data_with_parameter.__doc__
@@ -465,4 +452,3 @@ def delete_data(instance_id, database_id):
465452
delete_data_with_dml(args.instance_id, args.database_id)
466453
elif args.command == "delete_data":
467454
delete_data(args.instance_id, args.database_id)
468-

0 commit comments

Comments
 (0)