Skip to content

Commit c372788

Browse files
remove excess methods
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 8257529 commit c372788

File tree

3 files changed

+2
-55
lines changed

3 files changed

+2
-55
lines changed

src/databricks/sql/backend/filters.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
TYPE_CHECKING,
1818
)
1919

20-
from databricks.sql.utils import JsonQueue, SeaResultSetQueueFactory
2120
from databricks.sql.backend.types import ExecuteResponse, CommandId
2221
from databricks.sql.backend.sea.models.base import ResultData
2322
from databricks.sql.backend.sea.backend import SeaDatabricksClient

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

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -305,59 +305,6 @@ def get_allowed_session_configurations() -> List[str]:
305305
"""
306306
return list(ALLOWED_SESSION_CONF_TO_DEFAULT_VALUES_MAP.keys())
307307

308-
def fetch_chunk_links(
309-
self, statement_id: str, chunk_index: int
310-
) -> List["ExternalLink"]:
311-
"""
312-
Fetch links for a specific chunk index from the SEA API.
313-
314-
Args:
315-
statement_id: The statement ID
316-
chunk_index: The chunk index to fetch
317-
318-
Returns:
319-
List[ExternalLink]: List of external links for the chunk
320-
321-
Raises:
322-
Error: If there's an error fetching the chunk links
323-
"""
324-
from databricks.sql.backend.sea.models.responses import GetChunksResponse
325-
from databricks.sql.backend.sea.models.base import ExternalLink
326-
327-
logger.info(f"Fetching chunk {chunk_index} links for statement {statement_id}")
328-
329-
# Use the chunk-specific endpoint if we have a specific chunk index
330-
path = self.CHUNK_PATH_WITH_ID_AND_INDEX.format(statement_id, chunk_index)
331-
332-
response_data = self.http_client._make_request(
333-
method="GET",
334-
path=path,
335-
)
336-
337-
# Extract the external_links from the response
338-
external_links = response_data.get("external_links", [])
339-
logger.info(
340-
f"Received {len(external_links)} external links for chunk {chunk_index}"
341-
)
342-
343-
# Convert the links to ExternalLink objects
344-
links = []
345-
for link_data in external_links:
346-
link = ExternalLink(
347-
external_link=link_data.get("external_link", ""),
348-
expiration=link_data.get("expiration", ""),
349-
chunk_index=link_data.get("chunk_index", 0),
350-
byte_count=link_data.get("byte_count", 0),
351-
row_count=link_data.get("row_count", 0),
352-
row_offset=link_data.get("row_offset", 0),
353-
next_chunk_index=link_data.get("next_chunk_index"),
354-
next_chunk_internal_link=link_data.get("next_chunk_internal_link"),
355-
http_headers=link_data.get("http_headers", {}),
356-
)
357-
links.append(link)
358-
359-
return links
360-
361308
def get_chunk_links(
362309
self, statement_id: str, chunk_index: int
363310
) -> "GetChunksResponse":

src/databricks/sql/cloud_fetch_queue.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ def _fetch_chunk_link(self, chunk_index: int) -> Optional["ExternalLink"]:
359359
)
360360

361361
# Use the SEA client to fetch the chunk links
362-
links = self._sea_client.fetch_chunk_links(self._statement_id, chunk_index)
362+
chunk_info = self._sea_client.get_chunk_links(self._statement_id, chunk_index)
363+
links = chunk_info.links
363364

364365
if not links:
365366
logger.debug(

0 commit comments

Comments
 (0)