Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
asthamohta committed Oct 27, 2022
1 parent 4910f59 commit 8563815
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
20 changes: 19 additions & 1 deletion samples/samples/pg_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ def update_data_with_jsonb(instance_id, database_id):


def query_data_with_jsonb_parameter(instance_id, database_id):
"""Queries sample data using SQL with a JSON parameter."""
"""Queries sample data using SQL with a JSONB parameter."""
# [START spanner_postgresql_jsonb_query_parameter]
# instance_id = "your-spanner-instance"
# database_id = "your-spanner-db-id"
Expand Down Expand Up @@ -1534,6 +1534,18 @@ def query_data_with_jsonb_parameter(instance_id, database_id):
"create_client_with_query_options",
help=create_client_with_query_options.__doc__,
)
subparsers.add_parser(
"add_jsonb_column",
help=add_jsonb_column.__doc__,
)
subparsers.add_parser(
"update_data_with_jsonb",
help=update_data_with_jsonb.__doc__,
)
subparsers.add_parser(
"query_data_with_jsonb_parameter",
help=query_data_with_jsonb_parameter.__doc__,
)

args = parser.parse_args()

Expand Down Expand Up @@ -1623,3 +1635,9 @@ def query_data_with_jsonb_parameter(instance_id, database_id):
query_data_with_query_options(args.instance_id, args.database_id)
elif args.command == "create_client_with_query_options":
create_client_with_query_options(args.instance_id, args.database_id)
elif args.command == "add_jsonb_column":
add_jsonb_column(args.instance_id, args.database_id)
elif args.command == "update_data_with_jsonb":
update_data_with_jsonb(args.instance_id, args.database_id)
elif args.command == "query_data_with_jsonb_parameter":
query_data_with_jsonb_parameter(args.instance_id, args.database_id)
4 changes: 3 additions & 1 deletion tests/system/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def spanner_client():
)
else:
return spanner_v1.Client(
client_options={"api_endpoint": "staging-wrenchworks.sandbox.googleapis.com"}
client_options={
"api_endpoint": "staging-wrenchworks.sandbox.googleapis.com"
}
) # use google.auth.default credentials


Expand Down
5 changes: 4 additions & 1 deletion tests/system/test_session_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2106,7 +2106,10 @@ def test_execute_sql_w_json_bindings(
[JSON_1, JSON_2],
)

def test_execute_sql_w_jsonb_bindings(not_emulator, not_google_standard_sql, sessions_database, database_dialect):

def test_execute_sql_w_jsonb_bindings(
not_emulator, not_google_standard_sql, sessions_database, database_dialect
):
_bind_test_helper(
sessions_database,
database_dialect,
Expand Down

0 comments on commit 8563815

Please sign in to comment.