chore(mssql): always append semicolon to statement#11732
Merged
gforsyth merged 2 commits intoibis-project:mainfrom Nov 2, 2025
Merged
chore(mssql): always append semicolon to statement#11732gforsyth merged 2 commits intoibis-project:mainfrom
gforsyth merged 2 commits intoibis-project:mainfrom
Conversation
gforsyth
reviewed
Nov 2, 2025
ibis/backends/mssql/__init__.py
Outdated
| # Although the semicolon isn't required for most statements, the | ||
| # T-SQL docs state that it will be required in a future version. | ||
| # https://learn.microsoft.com/en-us/sql/t-sql/language-elements/transact-sql-syntax-conventions-transact-sql?view=sql-server-ver17&tabs=code | ||
| query = f"{query};" |
Member
There was a problem hiding this comment.
Can we check if the semicolon is already present and then suffix it if not?
If sqlglot adds in the semicolon in response to the upstream change in tsql we'll want to avoid doubling it up, I think
Collaborator
Author
There was a problem hiding this comment.
Done, with an rstrip() for good measure: cf07db4
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Terminate all MSSQL statements with a semicolon. This is required for some statements (e.g.
MERGE).Raising a separate PR so that this broader change (not solely affecting
Backend.upsert()implementation) is reflected in the changelog. All tests pass as-is.