Skip to content

Commit a92acb2

Browse files
committed
Rebase to upstream v3.0.2
1 parent faf13a4 commit a92acb2

File tree

2 files changed

+14
-165
lines changed

2 files changed

+14
-165
lines changed

.github/workflows/code-quality-checks.yml

Lines changed: 0 additions & 163 deletions
This file was deleted.

src/databricks/sql/thrift_backend.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
DATABRICKS_REASON_HEADER = "x-databricks-reason-phrase"
5555

5656
TIMESTAMP_AS_STRING_CONFIG = "spark.thriftserver.arrowBasedRowSet.timestampAsString"
57+
58+
# HACK!
59+
THRIFT_SOCKET_TIMEOUT = os.getenv("THRIFT_SOCKET_TIMEOUT", None)
60+
5761
DEFAULT_SOCKET_TIMEOUT = float(900)
5862

5963
# see Connection.__init__ for parameter descriptions.
@@ -227,7 +231,12 @@ def __init__(
227231
**additional_transport_args, # type: ignore
228232
)
229233

230-
timeout = kwargs.get("_socket_timeout", DEFAULT_SOCKET_TIMEOUT)
234+
timeout = THRIFT_SOCKET_TIMEOUT or kwargs.get(
235+
"_socket_timeout", DEFAULT_SOCKET_TIMEOUT
236+
)
237+
# HACK!
238+
logger.info(f"Setting timeout HACK! to {timeout}")
239+
231240
# setTimeout defaults to 15 minutes and is expected in ms
232241
self._transport.setTimeout(timeout and (float(timeout) * 1000.0))
233242

@@ -637,7 +646,10 @@ def _create_arrow_table(self, t_row_set, lz4_compressed, schema_bytes, descripti
637646
num_rows,
638647
) = convert_column_based_set_to_arrow_table(t_row_set.columns, description)
639648
elif t_row_set.arrowBatches is not None:
640-
(arrow_table, num_rows,) = convert_arrow_based_set_to_arrow_table(
649+
(
650+
arrow_table,
651+
num_rows,
652+
) = convert_arrow_based_set_to_arrow_table(
641653
t_row_set.arrowBatches, lz4_compressed, schema_bytes
642654
)
643655
else:

0 commit comments

Comments
 (0)