[go: up one dir, main page]

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

feat: support partitioned dml in dbapi #1103

Merged
merged 5 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
Small fix
  • Loading branch information
ankiaga committed Feb 15, 2024
commit 05abc1f14eb6c51d78b6845f234aecfb66fe92d8
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def parse_stmt(query):
elif RE_RUN_PARTITION.match(query):
match = re.search(RE_RUN_PARTITION, query)
client_side_statement_params.append(match.group(3))
client_side_statement_type = ClientSideStatementType.RUN_PARTITION
elif RE_SET_AUTOCOMMIT_DML_MODE.match(query):
match = re.search(RE_SET_AUTOCOMMIT_DML_MODE, query)
client_side_statement_params.append(match.group(4))
Expand Down
7 changes: 5 additions & 2 deletions tests/unit/spanner_dbapi/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,11 @@ def test_set_autocommit_dml_mode(self):
["PARTITIONED_NON_ATOMIC"],
)

with self.assertRaises(ProgrammingError):
self._under_test.set_autocommit_dml_mode(parsed_statement)
self._under_test.set_autocommit_dml_mode(parsed_statement)
assert (
self._under_test.autocommit_dml_mode
== AutocommitDmlMode.PARTITIONED_NON_ATOMIC
)

@mock.patch("google.cloud.spanner_v1.database.Database", autospec=True)
def test_run_prior_DDL_statements(self, mock_database):
Expand Down