Skip to content

Commit e031663

Browse files
committed
removed function in test_fetches cuz it is only used once
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
1 parent 149d4a8 commit e031663

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/databricks/sql/telemetry/latency_logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def get_extractor(obj):
145145
TelemetryExtractor: A specialized extractor instance:
146146
- CursorExtractor for Cursor objects
147147
- ResultSetExtractor for ResultSet objects
148-
- TelemetryExtractor (base) for all other objects
148+
- Throws an NotImplementedError for all other objects
149149
"""
150150
if obj.__class__.__name__ == "Cursor":
151151
return CursorExtractor(obj)

tests/unit/test_fetches.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ def make_dummy_result_set_from_initial_results(initial_results):
5959
]
6060
return rs
6161

62-
@staticmethod
63-
def mock_thrift_backend_with_retry_policy():
64-
mock_thrift_backend = Mock()
65-
mock_retry_policy = Mock()
66-
mock_retry_policy.history = []
67-
mock_thrift_backend.retry_policy = mock_retry_policy
68-
return mock_thrift_backend
69-
7062
@staticmethod
7163
def make_dummy_result_set_from_batch_list(batch_list):
7264
batch_index = 0
@@ -87,7 +79,10 @@ def fetch_results(
8779

8880
return results, batch_index < len(batch_list)
8981

90-
mock_thrift_backend = FetchTests.mock_thrift_backend_with_retry_policy()
82+
mock_thrift_backend = Mock()
83+
mock_retry_policy = Mock()
84+
mock_retry_policy.history = []
85+
mock_thrift_backend.retry_policy = mock_retry_policy
9186
mock_thrift_backend.fetch_results = fetch_results
9287
num_cols = len(batch_list[0][0]) if batch_list and batch_list[0] else 0
9388

0 commit comments

Comments
 (0)