Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

feat: Implementing client side statements in dbapi (starting with commit) - #1037

Merged
ankiaga merged 8 commits into
googleapis:mainfrom
ankiaga:client_statement
Nov 23, 2023
Merged

feat: Implementing client side statements in dbapi (starting with commit)#1037
ankiaga merged 8 commits into
googleapis:mainfrom
ankiaga:client_statement

Conversation

@ankiaga

@ankiagaankiaga commented Nov 17, 2023

Copy link
Copy Markdown
Contributor

Implementation to Commit the ongoing transaction whenever execute() method of Cursor is called with a sql query "COMMIT" (or "COMMIT TRANSACTION")
The plan is to later add more client side statements

@ankiaga
ankiaga requested review from a teamNovember 17, 2023 09:25
@product-auto-labelproduct-auto-labelBot added size: m Pull request size is medium. api: spanner Issues related to the googleapis/python-spanner API. labels Nov 17, 2023
@ankiaga
ankiaga marked this pull request as draft November 17, 2023 09:25
@product-auto-labelproduct-auto-labelBot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Nov 20, 2023
@ankiagaankiaga changed the title Implementing client side statement in dbapi starting with commitfeat: Implementing client side statements in dbapi (starting with commit)Nov 20, 2023
@conventional-commit-lint-gcf

conventional-commit-lint-gcfBot commented Nov 20, 2023

Copy link
Copy Markdown

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@ankiaga
ankiaga marked this pull request as ready for review November 20, 2023 07:35

@aseeringaseering left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together! No major concerns but a bunch of little comments. Let me know what you think.

Comment threadgoogle/cloud/spanner_dbapi/client_side_statement_executor.py Outdated
Comment threadgoogle/cloud/spanner_dbapi/client_side_statement_parser.py Outdated
Comment threadgoogle/cloud/spanner_dbapi/client_side_statement_executor.py Outdated
Comment threadgoogle/cloud/spanner_dbapi/client_side_statement_executor.py Outdated
Comment threadgoogle/cloud/spanner_dbapi/client_side_statement_executor.py Outdated
Comment threadtests/system/test_dbapi.py
Comment threadtests/system/test_dbapi.py
Comment threadgoogle/cloud/spanner_dbapi/parse_utils.py
Comment threadgoogle/cloud/spanner_dbapi/client_side_statement_parser.py
Comment threadgoogle/cloud/spanner_dbapi/cursor.py Outdated
@ankiaga

Copy link
Copy Markdown
ContributorAuthor

Thanks @aseering for taking out time and providing valuable comments. Got to learn a lot from your comments

Comment threadgoogle/cloud/spanner_dbapi/client_side_statement_executor.py
Comment threadgoogle/cloud/spanner_dbapi/client_side_statement_executor.py Outdated
Comment threadgoogle/cloud/spanner_dbapi/client_side_statement_parser.py
Comment threadgoogle/cloud/spanner_dbapi/client_side_statement_parser.py Outdated
Comment threadgoogle/cloud/spanner_dbapi/cursor.py
@ankiagaankiaga added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 23, 2023
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 23, 2023
@ankiaga
ankiaga merged commit eb41b0d into googleapis:mainNov 23, 2023
@release-pleaserelease-pleaseBot mentioned this pull request Nov 23, 2023
RE_PYFORMAT = re.compile(r"(%s|%\([^\(\)]+\)s)+", re.DOTALL)


@deprecated(reason="This method is deprecated. Use _classify_stmt method")

@asottile-sentryasottile-sentryMar 11, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this pulls in two new dependencies (deprecated, wrapt) into this library -- this can be replaced entirely with this inside the function body:

warnings.warn("This method is deprecated. Use classify_statement method instead", stacklevel=2)

this uses warnings directly avoiding the two new dependencies (including one which has a C extension!)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would one be open to a PR to do this instead?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ankiaga Would you mind taking a look what would be the best solution here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

threw one together: #1120

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spannerIssues related to the googleapis/python-spanner API.size: lPull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@ankiaga@aseering@olavloite@asottile-sentry@yoshi-kokoro