Repository navigation
Conversation
….SQLState No production code calls them; only tests did. The unit tests that went through ExecuteScalar now check Execute's rows directly, and the integration tests drop the parts that only checked the removed API. Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
✅ Integration test reportCommit: 1cd2e02
Top 6 slowest tests (at least 2 minutes):
|
denik
marked this pull request as ready for review
November 27, 2026 12:23
denik
requested review from
Sankalp-Mittal,
andrewnester and
mihaimitrea-db
and removed request for
mihaimitrea-db
November 27, 2026 12:23
There was a problem hiding this comment.
Automated review at b26807e. Each finding was verified against the code.
No blocking issues found. 1 non-blocking comment(s) below.
This PR removes Client.ExecuteScalar, Result.Scalar and StatementError.SQLState from libs/sqlexec, since nothing reachable from the CLI uses them, and moves the affected tests to Execute's rows. I traced the rewritten tests. Results leaves Rows nil when the response has no data, so the "no rows" case with a nil want still passes. The kept integration tests still cover NULL binding and the FAILED error. The only leftover I found is test fixtures that still set a SQLSTATE nothing reads.
andrewnester
approved these changes
Nov 27, 2026
Co-authored-by: Isaac <no-reply@databricks.com>
andrewnester
approved these changes
Nov 27, 2026
This branch has not been deployed
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.
Changes
Removes three parts of
libs/sqlexecthat no production code uses:Client.ExecuteScalarResult.ScalarStatementError.SQLStatefieldTests that only checked them are removed with them:
integration/libs/sqlexecTestSQLExecScalarExecuteScalar, it checks thatExecutereturns rows, whichTestSQLExecColumnsAndRowsalso checksintegration/libs/sqlexecTestSQLExecNullParameterExecuteand checks the row: binding an empty--param x=as NULL is behaviorexperimental aitools tools queryrelies onintegration/libs/sqlexecTestSQLExecFailedStatementSQLStateassertion: the typed error's state, code and message are what the CLI reportslibs/sqlexecunit testsTestResultScalardeleted;TestExecuteScalar(nowTestExecute),TestExecutePollsUntilTerminalandTestHTTPExecutePollscheckExecute's rows instead ofExecuteScalar; oneSQLStateassertion and oneScalar()assertion droppedNo user-visible change, so no changelog entry.
Why
Part of moving the deprecated integration tests (integration/README.md) to acceptance tests. #8072 ports the sqlexec facts that shipped commands rely on to
Cloud = trueacceptance tests throughexperimental aitools tools queryandstatement: results, parameters, NULL binding, the FAILED error, submit and cancel. What those tests can't reach is code that nothing ships, so it goes instead of being tested. This PR is separate from #8072 so each is easier to review.Evidence on main (e5eb6a3) before the change:
rg 'ExecuteScalar|\.Scalar\(\)|SQLState': outside_test.gofiles the only hits are the definitions inlibs/sqlexec/sqlexec.go, pluslibs/testserver/testsql. That package has its ownError.SQLState, which fills the fake API response'ssql_statelike the real API does, so it stays.go tool -modfile=tools/go.mod deadcode ./...(no-test, so only code reachable from the CLI'smain):StatementError.SQLStateis only written innewStatementErrorand only read by tests.tools/check_deadcode.pyreports no dead code.Tests
go test ./libs/sqlexec/...TestSQLExecNullParameterandTestSQLExecFailedStatementpass.Gaps and risks
WithWaitTimeoutandWithPollIntervalas unreachable frommain. Unit tests use them to configure the client, so they are left out of this PR.This PR was created by the integration-deprecation loop.
🤖 AI agent (opus5.5, isaac_claude)
This pull request and its description were written by Isaac.