Skip to content

Commit dc3a1fb

Browse files
move use_sea init to Session constructor
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent bb3e94d commit dc3a1fb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/databricks/sql/session.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ def __init__(
7676
tls_client_cert_key_password=kwargs.get("_tls_client_cert_key_password"),
7777
)
7878

79+
self.use_sea = kwargs.get("use_sea", False)
7980
self.backend = self._create_backend(
81+
self.use_sea,
8082
server_hostname,
8183
http_path,
8284
all_headers,
@@ -89,6 +91,7 @@ def __init__(
8991

9092
def _create_backend(
9193
self,
94+
use_sea: bool,
9295
server_hostname: str,
9396
http_path: str,
9497
all_headers: List[Tuple[str, str]],
@@ -97,10 +100,8 @@ def _create_backend(
97100
kwargs: dict,
98101
) -> DatabricksClient:
99102
"""Create and return the appropriate backend client."""
100-
self.use_sea = kwargs.get("use_sea", False)
101-
102103
databricks_client_class: Type[DatabricksClient]
103-
if self.use_sea:
104+
if use_sea:
104105
logger.debug("Creating SEA backend client")
105106
databricks_client_class = SeaDatabricksClient
106107
else:

0 commit comments

Comments
 (0)