Skip to content

Commit a7f8876

Browse files
remove redundant (un-used) methods
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 2c0f303 commit a7f8876

File tree

2 files changed

+2
-60
lines changed

2 files changed

+2
-60
lines changed

src/databricks/sql/backend/sea/backend.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -294,29 +294,6 @@ def close_session(self, session_id: SessionId) -> None:
294294
data=request_data.to_dict(),
295295
)
296296

297-
@staticmethod
298-
def get_default_session_configuration_value(name: str) -> Optional[str]:
299-
"""
300-
Get the default value for a session configuration parameter.
301-
302-
Args:
303-
name: The name of the session configuration parameter
304-
305-
Returns:
306-
The default value if the parameter is supported, None otherwise
307-
"""
308-
return ALLOWED_SESSION_CONF_TO_DEFAULT_VALUES_MAP.get(name.upper())
309-
310-
@staticmethod
311-
def get_allowed_session_configurations() -> List[str]:
312-
"""
313-
Get the list of allowed session configuration parameters.
314-
315-
Returns:
316-
List of allowed session configuration parameter names
317-
"""
318-
return list(ALLOWED_SESSION_CONF_TO_DEFAULT_VALUES_MAP.keys())
319-
320297
def _extract_description_from_manifest(
321298
self, manifest: ResultManifest
322299
) -> Optional[List]:

tests/unit/test_sea_backend.py

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -519,43 +519,8 @@ def test_check_command_state(self, sea_client, sea_command_id):
519519
)
520520
assert "Command failed" in str(excinfo.value)
521521

522-
def test_utility_methods(self, sea_client):
523-
"""Test utility methods."""
524-
# Test get_default_session_configuration_value
525-
value = SeaDatabricksClient.get_default_session_configuration_value("ANSI_MODE")
526-
assert value == "true"
527-
528-
# Test with unsupported configuration parameter
529-
value = SeaDatabricksClient.get_default_session_configuration_value(
530-
"UNSUPPORTED_PARAM"
531-
)
532-
assert value is None
533-
534-
# Test with case-insensitive parameter name
535-
value = SeaDatabricksClient.get_default_session_configuration_value("ansi_mode")
536-
assert value == "true"
537-
538-
# Test get_allowed_session_configurations
539-
configs = SeaDatabricksClient.get_allowed_session_configurations()
540-
assert isinstance(configs, list)
541-
assert len(configs) > 0
542-
assert "ANSI_MODE" in configs
543-
544-
# Test getting the list of allowed configurations with specific keys
545-
allowed_configs = SeaDatabricksClient.get_allowed_session_configurations()
546-
expected_keys = {
547-
"ANSI_MODE",
548-
"ENABLE_PHOTON",
549-
"LEGACY_TIME_PARSER_POLICY",
550-
"MAX_FILE_PARTITION_BYTES",
551-
"READ_ONLY_EXTERNAL_METASTORE",
552-
"STATEMENT_TIMEOUT",
553-
"TIMEZONE",
554-
"USE_CACHED_RESULT",
555-
}
556-
assert set(allowed_configs) == expected_keys
557-
558-
# Test _extract_description_from_manifest
522+
def test_extract_description_from_manifest(self, sea_client):
523+
"""Test _extract_description_from_manifest."""
559524
manifest_obj = MagicMock()
560525
manifest_obj.schema = {
561526
"columns": [

0 commit comments

Comments
 (0)