New Container: DatabricksContainer for Databricks SQL Connector
@WPrendota is already working on this.
Since Mar 12, 2026.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reading the existing AzuriteContainer and PostgresContainer modules, then review the DockerContainer API and the databricks.sql connection parameters named in the issue. Done means defining a DatabricksContainer that works with a user-provided mock image, performs readiness handling, and exposes server_hostname, http_path, and token helpers.
Written by the indexing model from the issue text.
Description
What is the new container you'd like to have?
I propose the addition of a DatabricksContainer module to facilitate testing applications that use the databricks-sql-connector. This would allow developers to run integration and end-to-end tests against a mock Databricks SQL API in an isolated and reproducible manner.
Unlike many services, Databricks does not provide an official local emulator in a Docker container. Therefore, this module would be designed to work with a user-provided Docker image that runs a mock server emulating the Databricks SQL API.
The benefits of having this dedicated container module include:
- Isolated Testing: Enables hermetic tests without relying on shared, live Databricks workspaces.
- CI/CD Integration: Simplifies running automated tests in CI/CD pipelines without complex credential management or network configurations.
- Developer Experience: Provides a simple, Pythonic interface consistent with other testcontainers modules like AzuriteContainer or PostgresContainer.
- Reliability: Eliminates test flakiness caused by network issues or changes in shared development environments.
Why not just use a generic container for this?
While it is possible to use a generic DockerContainer("my-databricks-mock:latest"), a dedicated DatabricksContainer module would abstract away significant complexity related to configuration and readiness checks.
- Complicated Setup and Configuration:
The databricks-sql-connector requires specific connection parameters: server_hostname, http_path, and access_token. A user of DockerContainer would have to manually:
- Get the container's dynamic IP address and port.
- Correctly format the server_hostname and http_path.
- Know which token the mock server expects.
- This process is cumbersome and error-prone.
Generic DockerContainer approach :
from databricks import sql
from testcontainers.core.container import DockerContainer
with DockerContainer("my-databricks-mock:latest").with_exposed_ports(8080) as mock_container:
host = mock_container.get_container_host_ip()
port = mock_container.get_exposed_port(8080)
# User must manually construct connection parameters
connection = sql.connect(
server_hostname=host,
http_path=f"/sql/1.0/warehouses/{port}", # Path might be complex and mock-specific
access_token="dummy-token"
)
A dedicated DatabricksContainer would provide helper methods to abstract this away, offering a much cleaner interface.
Proposed DatabricksContainer approach:
from databricks import sql
# from testcontainers.databricks import DatabricksContainer
with DatabricksContainer as databricks_container:
# Clean, abstracted methods
connection = sql.connect(
server_hostname=databricks_container.get_server_hostname(),
http_path=databricks_container.get_http_path(),
access_token=databricks_container.get_token()
)
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 397
- Avg merge
- 8d 16h
- Merged PRs (30d)
- 5
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from testcontainers/testcontainers-python
-
Feature: Stream bytes out on copy_from_containerPossibly taken @archit15singh claimed this 11 days ago. Open🚀 enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Bug: HttpWaitStrategy ignores response predicates for accepted HTTP error statusesPossibly taken @PranavMulakala claimed this 41 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Bug: LogMessageWaitStrategy: a container that exits before its message raises without its logs, and __enter__ then removes the containerPossibly taken @granzer69 claimed this 42 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
testcontainers/testcontainers-python#1086 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
testcontainers/testcontainers-python#578 · 5 comments ·
All issues in testcontainers/testcontainers-python
Similar issues
-
bug feature request
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Qiskit/qiskit-obp#156 ·
-
action-item enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
getcommunityone/open-navigator#1658 ·
Maintainers usually reply within 1 day
-
review-panel severity:low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kristovatlas/coin-accounting#636 ·
Maintainers usually reply within 1 day