Skip to content

Commit

Permalink
Merge branch 'main' into rebase-to-main-package
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-fleming authored Jan 26, 2024
2 parents fddc9f9 + 8347257 commit 377e158
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/databricks/sql/thrift_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import logging
import math
import os
import time
import uuid
import threading
import time
from decimal import Decimal

from ssl import CERT_NONE, CERT_REQUIRED, create_default_context
from typing import List, Union

Expand All @@ -15,15 +16,13 @@
import thrift.transport.THttpClient
import thrift.transport.TSocket
import thrift.transport.TTransport

import urllib3.exceptions

import databricks.sql.auth.thrift_http_client
from databricks.sql.auth.thrift_http_client import CommandType
from databricks.sql.auth.authenticators import AuthProvider
from databricks.sql.thrift_api.TCLIService import TCLIService, ttypes
from databricks.sql import *
from databricks.sql.exc import MaxRetryDurationError
from databricks.sql.thrift_api.TCLIService.TCLIService import (
Client as TCLIServiceClient,
)
Expand Down Expand Up @@ -154,7 +153,6 @@ def __init__(
self._use_arrow_native_complex_types = kwargs.get("_use_arrow_native_complex_types", True)
self._use_arrow_native_decimals = kwargs.get("_use_arrow_native_decimals", True)
self._use_arrow_native_timestamps = kwargs.get("_use_arrow_native_timestamps", True)

# Cloud fetch
self.max_download_threads = kwargs.get("max_download_threads", 10)

Expand Down Expand Up @@ -206,8 +204,11 @@ def __init__(
**additional_transport_args, # type: ignore
)

# HACK!
timeout = THRIFT_SOCKET_TIMEOUT or kwargs.get("_socket_timeout", DEFAULT_SOCKET_TIMEOUT)
logger.info(f"Setting timeout HACK! to {timeout}")
# setTimeout defaults to 15 minutes and is expected in ms

self._transport.setTimeout(timeout and (float(timeout) * 1000.0))

self._transport.setCustomHeaders(dict(http_headers))
Expand Down

0 comments on commit 377e158

Please sign in to comment.