Repository navigation
refactor!: remove the deprecated use_sea backend - #1073
aakash-saravanan-db wants to merge 3 commits into
Conversation
The pure-Python SEA backend is superseded by use_kernel=True. Delete backend/sea/ with its unit tests and experimental examples, and drop the use_sea cases from the e2e suites. connect() now raises ValueError for use_sea=True before any auth, HTTP client or telemetry setup, pointing callers to use_kernel=True. The SEA-only use_hybrid_disposition and max_connections options are gone. SqlType moves into kernel/type_mapping.py, its only remaining user. Connection.__del__ now tolerates a Connection whose __init__ raised before a session was assigned. Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
HTTP429Suite and HTTP503Suite have not been collected since #352 moved their base class off unittest.TestCase: their names do not match pytest's Test* pattern. They also needed a server that returns real 429/503 responses. Remove them together with the mixins and the PySQLPytestTestCase attributes only they used. Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
No issues identified in the part of the change that was reviewed.
Review incomplete
This review did not cover the whole change, so it is posted as a comment and does not approve the PR. Review the items below by hand, or split the PR so the bot can cover all of it:
- The PR diff exceeded the 200,000-byte review cap, so 19 test hunk(s) were not shown to the reviewer (tests:
tests/unit/test_filters.py,tests/unit/test_lazy_thrift_import.py,tests/unit/test_sea_backend.py,tests/unit/test_sea_conversion.py,tests/unit/test_sea_http_client.py,tests/unit/test_sea_queue.py,tests/unit/test_sea_result_set.py,tests/unit/test_session.py,tests/unit/test_telemetry.py); no production code was dropped.
The first commit dropped enable_sea_hybrid_results from DriverConnectionParameters. Every telemetry event a Thrift connection exports embeds those parameters, so the field disappeared from all of them. Restore the previous value so connection telemetry is unchanged for Thrift and kernel connections. Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 Nit
Looks good, no blocking issues. A repo-wide grep finds no remaining imports of backend.sea, SeaDatabricksClient, from_sea_state or session.use_sea. The new use_sea rejection and the __del__ guard each have unit tests. RT/Lakehouse warehouses now need use_kernel=True; worth a mention in the release notes.
Other findings
- ⚪ Nit —
.claude/knowledge/learning-log.md:40-43still describeuse_sea=Trueas the only backend for RT/Lakehouse warehouses. Those entries are now stale. Update them to point atuse_kernel=Trueso later bot runs don't steer users to a removed flag. (Found by Claude Opus 5.5 · the judge disputed it but couldn't back that up, so it's kept)
Review incomplete
This review did not cover the whole change, so it is posted as a comment and does not approve the PR. Review the items below by hand, or split the PR so the bot can cover all of it:
- The PR diff exceeded the 200,000-byte review cap, so 19 test hunk(s) were not shown to the reviewer (tests:
tests/unit/test_filters.py,tests/unit/test_lazy_thrift_import.py,tests/unit/test_sea_backend.py,tests/unit/test_sea_conversion.py,tests/unit/test_sea_http_client.py,tests/unit/test_sea_queue.py,tests/unit/test_sea_result_set.py,tests/unit/test_session.py,tests/unit/test_telemetry.py); no production code was dropped.
What type of PR is this?
Description
Removes the deprecated pure-Python SEA backend (
use_sea=True).use_kernel=True(the Rust kernel) is the supported SEA-native path.Behavior changes
use_sea=Truenow raisesValueErrorat the top ofConnection.__init__, before any auth, HTTP client or telemetry setup. The message points callers touse_kernel=Trueand the[kernel]extra.use_sea=Falseis still accepted.use_hybrid_dispositionandmax_connectionsoptions are removed and ignored if passed.DriverConnectionParameters.modeis alwaysTHRIFT. Kernel connections already computedTHRIFThere, sinceuse_seawas false on that path.enable_sea_hybrid_resultsstill reportsuse_hybrid_disposition, so the connection telemetry payload is unchanged for Thrift and kernel connections.Connection.__del__no longer raises when__init__failed before a session was assigned. Previously Python printedException ignored in __del__: AttributeErrornext to the real error, and the newuse_seaerror is the most common way to hit that path.Code
src/databricks/sql/backend/sea/andCommandState.from_sea_state, which only SEA used.SqlTypeintobackend/kernel/type_mapping.py, its only remaining user, keeping the 15 constants the kernel references.BackendType.SEA,SessionId.from_sea_session_idandCommandId.from_sea_statement_id: the kernel backend builds its session and statement IDs with them.Session._create_backendand from the Reyden auto-recovery check.Tests and docs
test_sea_*.py,test_filters.py) andexamples/experimental/.{"use_sea": True}cases from the e2e suites. Only the default case remained, so theextra_paramsparametrize and argument are removed from those tests.HTTP429Suite/HTTP503Suiteand their mixins. These have not been collected since Prep for Test Automation #352 moved their base class offunittest.TestCase, because their names do not match pytest'sTest*pattern. They also needed a server that returns real 429/503 responses.CONNECTION_PARAMETERS.md,CONTRIBUTING.md, the engineer bot prompt andCHANGELOG.md.Follow-up: coverage for the deleted 429/503 suites
We will make sure each behavior those suites targeted is covered by a test that actually runs in CI, either by confirming the existing coverage below or by adding a test:
Retry-Aftertest_retry_max_count_not_exceededandtest_retry_exponential_backoff(PySQLRetryTestsMixin, run viaTestPySQLCoreSuiteincode-coverage.yml) andtests/unit/test_retry.pytest_retry_safe_execute_statement_retry_conditiontest_retry_safe_execute_statement_retry_conditionOperationalErrorcontainingTEMPORARILY_UNAVAILABLEHow is this tested?
Unit tests
E2E Tests
Manually
N/A
pytest tests/unit -m "not realkernel": 1298 passed, 4 skipped.New
test_use_sea_rejected_before_any_setupchecks thatuse_sea=Trueraises before any HTTP client or Thrift client is created.New
test_rejected_connect_finalizes_quietlyfails without the__del__guard (verified by removing it) and passes with it.black --check srcis clean.E2E suites were not run locally;
code-coverage.ymlruns them on this PR.pytest --collect-only tests/e2e/test_driver.pycollects the same 99 tests before and after the suite deletion.Related Tickets & Documents
N/A
This pull request and its description were written by Isaac.