Skip to content

feat: Add last statement option samples #1341

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix formatting
  • Loading branch information
sgorse12 committed Apr 23, 2025
commit 7f9b2dc6bc50e64d8fcc4fbb892252eda9a3d2dd
2 changes: 1 addition & 1 deletion samples/samples/pg_snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,4 +517,4 @@ def test_dml_last_statement_option(capsys, instance_id, sample_database):
snippets.dml_last_statement_option(instance_id, sample_database.database_id)
out, _ = capsys.readouterr()
assert "1 record(s) inserted." in out
assert "1 record(s) updated." in out
assert "1 record(s) updated." in out
1 change: 1 addition & 0 deletions samples/samples/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,7 @@ def insert_singers(transaction):
database.run_in_transaction(insert_singers)
# [END spanner_dml_standard_insert]


# [START spanner_get_commit_stats]
def log_commit_stats(instance_id, database_id):
"""Inserts sample data using DML and displays the commit statistics."""
Expand Down
3 changes: 2 additions & 1 deletion samples/samples/snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,9 @@ def test_add_split_points(capsys, instance_id, sample_database):
out, _ = capsys.readouterr()
assert "Added split points." in out


def test_dml_last_statement_option(capsys, instance_id, sample_database):
snippets.dml_last_statement_option(instance_id, sample_database.database_id)
out, _ = capsys.readouterr()
assert "1 record(s) inserted." in out
assert "1 record(s) updated." in out
assert "1 record(s) updated." in out