Skip to content

Commit c0b989c

Browse files
move staging allowed local path to connection props
Signed-off-by: varun-edachali-dbx <[email protected]>
1 parent 8b6ba56 commit c0b989c

File tree

3 files changed

+3
-36
lines changed

3 files changed

+3
-36
lines changed

src/databricks/sql/backend/databricks_client.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -334,30 +334,6 @@ def get_columns(
334334
"""
335335
pass
336336

337-
# == Properties ==
338-
@property
339-
@abstractmethod
340-
def staging_allowed_local_path(self) -> Union[None, str, List[str]]:
341-
"""
342-
Gets the allowed local paths for staging operations.
343-
344-
Returns:
345-
Union[None, str, List[str]]: The allowed local paths for staging operations,
346-
or None if staging is not allowed
347-
"""
348-
pass
349-
350-
@property
351-
@abstractmethod
352-
def ssl_options(self) -> SSLOptions:
353-
"""
354-
Gets the SSL options for this client.
355-
356-
Returns:
357-
SSLOptions: The SSL configuration options
358-
"""
359-
pass
360-
361337
@property
362338
@abstractmethod
363339
def max_download_threads(self) -> int:

src/databricks/sql/backend/thrift_backend.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def __init__(
101101
http_headers,
102102
auth_provider: AuthProvider,
103103
ssl_options: SSLOptions,
104-
staging_allowed_local_path: Union[None, str, List[str]] = None,
105104
**kwargs,
106105
):
107106
# Internal arguments in **kwargs:
@@ -160,7 +159,6 @@ def __init__(
160159
else:
161160
raise ValueError("No valid connection settings.")
162161

163-
self._staging_allowed_local_path = staging_allowed_local_path
164162
self._initialize_retry_args(kwargs)
165163
self._use_arrow_native_complex_types = kwargs.get(
166164
"_use_arrow_native_complex_types", True
@@ -234,14 +232,6 @@ def __init__(
234232

235233
self._request_lock = threading.RLock()
236234

237-
@property
238-
def staging_allowed_local_path(self) -> Union[None, str, List[str]]:
239-
return self._staging_allowed_local_path
240-
241-
@property
242-
def ssl_options(self) -> SSLOptions:
243-
return self._ssl_options
244-
245235
@property
246236
def max_download_threads(self) -> int:
247237
return self._max_download_threads

src/databricks/sql/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ def read(self) -> Optional[OAuthToken]:
247247
self.use_inline_params = self._set_use_inline_params_with_warning(
248248
kwargs.get("use_inline_params", False)
249249
)
250+
self.staging_allowed_local_path = kwargs.get("staging_allowed_local_path", None)
250251

251252
def _set_use_inline_params_with_warning(self, value: Union[bool, str]):
252253
"""Valid values are True, False, and "silent"
@@ -793,7 +794,7 @@ def execute(
793794

794795
if execute_response.is_staging_operation:
795796
self._handle_staging_operation(
796-
staging_allowed_local_path=self.backend.staging_allowed_local_path
797+
staging_allowed_local_path=self.connection.staging_allowed_local_path
797798
)
798799

799800
return self
@@ -900,7 +901,7 @@ def get_async_execution_result(self):
900901

901902
if execute_response.is_staging_operation:
902903
self._handle_staging_operation(
903-
staging_allowed_local_path=self.backend.staging_allowed_local_path
904+
staging_allowed_local_path=self.connection.staging_allowed_local_path
904905
)
905906

906907
return self

0 commit comments

Comments
 (0)