Skip to content

refactor!: remove the deprecated use_sea backend - #1073

Open
aakash-saravanan-db wants to merge 2 commits into
mainfrom
aakash-saravanan-db/feat/remove-use-sea
Open

aakash-saravanan-db wants to merge 2 commits into
mainfrom
aakash-saravanan-db/feat/remove-use-sea

Conversation

@aakash-saravanan-db

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • Refactor

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=True now raises ValueError at the top of Connection.__init__, before any auth, HTTP client or telemetry setup. The message points callers to use_kernel=True and the [kernel] extra. use_sea=False is still accepted.
  • The SEA-only use_hybrid_disposition and max_connections options are removed and ignored if passed.
  • Telemetry DriverConnectionParameters.mode is always THRIFT. Kernel connections already computed THRIFT here, since use_sea was false on that path. enable_sea_hybrid_results is no longer populated.
  • Connection.__del__ no longer raises when __init__ failed before a session was assigned. Previously Python printed Exception ignored in __del__: AttributeError next to the real error, and the new use_sea error is the most common way to hit that path.

Code

  • Delete src/databricks/sql/backend/sea/ and CommandState.from_sea_state, which only SEA used.
  • Move SqlType into backend/kernel/type_mapping.py, its only remaining user, keeping the 15 constants the kernel references.
  • Keep BackendType.SEA, SessionId.from_sea_session_id and CommandId.from_sea_statement_id: the kernel backend builds its session and statement IDs with them.
  • Drop the SEA branch from Session._create_backend and from the Reyden auto-recovery check.

Tests and docs

  • Delete the SEA unit tests (test_sea_*.py, test_filters.py) and examples/experimental/.
  • Drop the {"use_sea": True} cases from the e2e suites. Only the default case remained, so the extra_params parametrize and argument are removed from those tests.
  • Second commit: delete HTTP429Suite / HTTP503Suite and their mixins. These have not been collected since Prep for Test Automation #352 moved their base class off unittest.TestCase, because their names do not match pytest's Test* pattern. They also needed a server that returns real 429/503 responses.
  • Update CONNECTION_PARAMETERS.md, CONTRIBUTING.md, the engineer bot prompt and CHANGELOG.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:

Behavior Coverage
Requests are retried on 429 and honor Retry-After Appears covered by test_retry_max_count_not_exceeded and test_retry_exponential_backoff (PySQLRetryTestsMixin, run via TestPySQLCoreSuite in code-coverage.yml) and tests/unit/test_retry.py
Capped retries raise on 429 Appears covered by test_retry_safe_execute_statement_retry_condition
A 503 while the cluster starts is retried Appears covered by the mocked 503 case in test_retry_safe_execute_statement_retry_condition
With retries disabled, a 503 surfaces as OperationalError containing TEMPORARILY_UNAVAILABLE No mocked equivalent found yet; to be added

How 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_setup checks that use_sea=True raises before any HTTP client or Thrift client is created.

  • New test_rejected_connect_finalizes_quietly fails without the __del__ guard (verified by removing it) and passes with it.

  • black --check src is clean.

  • E2E suites were not run locally; code-coverage.yml runs them on this PR. pytest --collect-only tests/e2e/test_driver.py collects 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.

aakash-saravanan-db and others added 2 commits November 21, 2026 01:00
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>

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔀 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.

This branch was previously deployed

1 inactive deployment
azure-prod — 62055be5 Deployed Nov 21, 2026 by aakash-saravanan-db via review #820
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants