Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/firebolt/async_db/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def cursor(self, **kwargs: Any) -> Cursor:
return c

# Server-side async methods
async def _get_async_query_info(self, token: str) -> AsyncQueryInfo:
async def get_async_query_info(self, token: str) -> AsyncQueryInfo:
if self.cursor_type != CursorV2:
raise FireboltError(
"This method is only supported for connection with service account."
Expand Down Expand Up @@ -130,7 +130,7 @@ async def is_async_query_running(self, token: str) -> bool:
Returns:
bool: True if async query is still running, False otherwise
"""
async_query_details = await self._get_async_query_info(token)
async_query_details = await self.get_async_query_info(token)
return async_query_details.status == ASYNC_QUERY_STATUS_RUNNING

async def is_async_query_successful(self, token: str) -> Optional[bool]:
Expand All @@ -144,7 +144,7 @@ async def is_async_query_successful(self, token: str) -> Optional[bool]:
bool: None if the query is still running, True if successful,
False otherwise
"""
async_query_details = await self._get_async_query_info(token)
async_query_details = await self.get_async_query_info(token)
if async_query_details.status == ASYNC_QUERY_STATUS_RUNNING:
return None
return async_query_details.status == ASYNC_QUERY_STATUS_SUCCESSFUL
Expand All @@ -156,7 +156,7 @@ async def cancel_async_query(self, token: str) -> None:
Args:
token: Async query token. Can be obtained from Cursor.async_query_token.
"""
async_query_details = await self._get_async_query_info(token)
async_query_details = await self.get_async_query_info(token)
async_query_id = async_query_details.query_id
cursor = self.cursor()
await cursor.execute(ASYNC_QUERY_CANCEL, [async_query_id])
Expand Down
8 changes: 4 additions & 4 deletions src/firebolt/db/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def close(self) -> None:

# Server-side async methods

def _get_async_query_info(self, token: str) -> AsyncQueryInfo:
def get_async_query_info(self, token: str) -> AsyncQueryInfo:
if self.cursor_type != CursorV2:
raise FireboltError(
"This method is only supported for connection with service account."
Expand Down Expand Up @@ -268,7 +268,7 @@ def is_async_query_running(self, token: str) -> bool:
Returns:
bool: True if async query is still running, False otherwise
"""
return self._get_async_query_info(token).status == ASYNC_QUERY_STATUS_RUNNING
return self.get_async_query_info(token).status == ASYNC_QUERY_STATUS_RUNNING

def is_async_query_successful(self, token: str) -> Optional[bool]:
"""
Expand All @@ -281,7 +281,7 @@ def is_async_query_successful(self, token: str) -> Optional[bool]:
bool: None if the query is still running, True if successful,
False otherwise
"""
async_query_info = self._get_async_query_info(token)
async_query_info = self.get_async_query_info(token)
if async_query_info.status == ASYNC_QUERY_STATUS_RUNNING:
return None
return async_query_info.status == ASYNC_QUERY_STATUS_SUCCESSFUL
Expand All @@ -293,7 +293,7 @@ def cancel_async_query(self, token: str) -> None:
Args:
token: Async query token. Can be obtained from Cursor.async_query_token.
"""
async_query_id = self._get_async_query_info(token).query_id
async_query_id = self.get_async_query_info(token).query_id
cursor = self.cursor()
cursor.execute(ASYNC_QUERY_CANCEL, [async_query_id])

Expand Down