1- #!/usr/bin/env python
2-
31import os
42import sys
53import logging
64from databricks .sql .client import Connection
75
8- # Configure logging
96logging .basicConfig (level = logging .DEBUG )
107logger = logging .getLogger (__name__ )
118
@@ -21,7 +18,6 @@ def test_sea_session():
2118 - DATABRICKS_HTTP_PATH: HTTP path for the SQL endpoint
2219 - DATABRICKS_TOKEN: Personal access token for authentication
2320 """
24- # Get connection parameters from environment variables
2521 server_hostname = os .environ .get ("DATABRICKS_SERVER_HOSTNAME" )
2622 http_path = os .environ .get ("DATABRICKS_HTTP_PATH" )
2723 access_token = os .environ .get ("DATABRICKS_TOKEN" )
@@ -32,25 +28,25 @@ def test_sea_session():
3228 logger .error ("Please set DATABRICKS_SERVER_HOSTNAME, DATABRICKS_HTTP_PATH, and DATABRICKS_TOKEN." )
3329 sys .exit (1 )
3430
35- # Print connection info (partially masked)
3631 logger .info (f"Connecting to { server_hostname } " )
3732 logger .info (f"HTTP Path: { http_path } " )
3833 if catalog :
3934 logger .info (f"Using catalog: { catalog } " )
4035
4136 try :
42- # Create connection with SEA backend
4337 logger .info ("Creating connection with SEA backend..." )
4438 connection = Connection (
4539 server_hostname = server_hostname ,
4640 http_path = http_path ,
4741 access_token = access_token ,
4842 catalog = catalog ,
49- use_sea = True , # Enable SEA backend
50- user_agent_entry = "SEA-Test-Client" # Add custom user agent
43+ schema = "default" ,
44+ use_sea = True ,
45+ user_agent_entry = "SEA-Test-Client" # add custom user agent
5146 )
5247
5348 logger .info (f"Successfully opened SEA session with ID: { connection .get_session_id_hex ()} " )
49+ logger .info (f"backend type: { type (connection .session .backend )} " )
5450
5551 # Close the connection
5652 logger .info ("Closing the SEA session..." )
0 commit comments