diff --git a/samples/samples/pg_snippets.py b/samples/samples/pg_snippets.py index 678cbc4435..c976af5db1 100644 --- a/samples/samples/pg_snippets.py +++ b/samples/samples/pg_snippets.py @@ -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" @@ -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() @@ -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) diff --git a/tests/system/conftest.py b/tests/system/conftest.py index d687837d56..26404ef346 100644 --- a/tests/system/conftest.py +++ b/tests/system/conftest.py @@ -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 diff --git a/tests/system/test_session_api.py b/tests/system/test_session_api.py index 2b8c8a4819..d91bed938a 100644 --- a/tests/system/test_session_api.py +++ b/tests/system/test_session_api.py @@ -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,