Skip to content

Conversation

hiroyukinakazato-db
Copy link

@hiroyukinakazato-db hiroyukinakazato-db commented Sep 30, 2025

Changes

This PR adds Switch, an LLM-powered transpiler, as an optional component in Lakebridge's install-transpile workflow. Switch installation is controlled by the new --include-llm-transpiler flag.

What does this PR do?

Implements complete Switch transpiler integration with idempotent installation, workspace deployment, job management, and resource configuration including Unity Catalog Volume for Switch.

Relevant implementation details

CLI Integration:

  • Add --include-llm-transpiler flag to install-transpile command (default: false)
  • Switch installation is opt-in, allowing users to choose between LSP-only or LLM-powered transpilation
  • Bladebridge and Morpheus continue to install by default

SwitchInstaller Implementation:

  • Extends TranspilerInstaller with unified constructor signature
  • WheelInstaller pattern for PyPI package management (databricks-switch-plugin)
  • Workspace deployment: uploads Switch package from site-packages to /Users/{user}/.lakebridge/switch/
  • Job creation: creates LAKEBRIDGE_Switch job with NotebookTask for parallel LLM processing
  • Resource configuration: prompts for catalog, schema, and volume for Switch
  • Idempotent behavior: supports reinstallation after uninstall with full recovery

Uninstall Integration:

  • Removes Switch job from workspace via InstallState
  • Logs manual cleanup instructions for validation schema and Switch resources (catalog, schema, volume)
  • Integrated into databricks labs uninstall lakebridge workflow

Caveats/things to watch out for when reviewing:

  • Opt-in by default: Switch is NOT installed by default. Users must explicitly specify --include-llm-transpiler flag to install Switch
  • User agent: Added include-llm-transpiler, "true" to user agent
  • Pylint configuration: Updated max-args from 12 to 13 in pyproject.toml to accommodate new CLI parameter
  • Resource lifecycle: Catalog, schema, and volume for Switch are prompted during install but require manual cleanup after uninstall
  • Job management: Switch job is tracked in InstallState and managed independently from Reconciliation jobs

Linked issues

Resolves #2048

Functionality

  • added relevant user documentation
  • added new CLI command
  • modified existing command: databricks labs lakebridge install-transpile (adds --include-llm-transpiler flag and Switch installation support)
  • modified existing command: databricks labs uninstall lakebridge (adds Switch job and resource cleanup)

Tests

  • manually tested
  • added unit tests
  • added integration tests

- Add Switch installer with resource configuration and job creation
- Implement uninstall functionality with proper cleanup
- Add comprehensive test coverage for SwitchInstaller
- Improve path handling and type-safe configuration
- Add include-llm-transpiler option for flexible installation
@hiroyukinakazato-db hiroyukinakazato-db added enhancement New feature or request feat/cli actions that are visible to the user labels Sep 30, 2025
Copy link

github-actions bot commented Sep 30, 2025

✅ 29/29 passed, 2 flaky, 1m23s total

Flaky tests:

  • 🤪 test_transpiles_informatica_with_sparksql (10.181s)
  • 🤪 test_transpile_sql_file (8.095s)

Running from acceptance #2464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feat/cli actions that are visible to the user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant