Skip to content

Commit 18fbb1b

Browse files
Merge remote-tracking branch 'origin/decouple-session' into backend-interface
2 parents 312b3c8 + 9190a33 commit 18fbb1b

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

.github/workflows/integration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Integration Tests
2+
23
on:
34
push:
45
paths-ignore:

src/databricks/sql/backend/thrift_backend.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,12 @@ def execute_command(
952952
thrift_handle,
953953
)
954954

955+
logger.debug(
956+
"ThriftBackend.execute_command(operation=%s, session_handle=%s)",
957+
operation,
958+
session_handle,
959+
)
960+
955961
spark_arrow_types = ttypes.TSparkArrowTypes(
956962
timestampAsArrow=self._use_arrow_native_timestamps,
957963
decimalAsArrow=self._use_arrow_native_decimals,

src/databricks/sql/client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,19 @@ def is_query_pending(self):
876876
ttypes.TOperationState.PENDING_STATE,
877877
]
878878

879+
def is_query_pending(self):
880+
"""
881+
Checks whether the async executing query is in pending state or not
882+
883+
:return:
884+
"""
885+
operation_state = self.get_query_state()
886+
887+
return not operation_state or operation_state in [
888+
ttypes.TOperationState.RUNNING_STATE,
889+
ttypes.TOperationState.PENDING_STATE,
890+
]
891+
879892
def get_async_execution_result(self):
880893
"""
881894

tests/e2e/test_complex_types.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def table_fixture(self, connection_details):
1414
# Create the table
1515
cursor.execute(
1616
"""
17-
CREATE TABLE IF NOT EXISTS pysql_test_complex_types_table (
17+
CREATE TABLE IF NOT EXISTS pysql_e2e_test_complex_types_table (
1818
array_col ARRAY<STRING>,
1919
map_col MAP<STRING, INTEGER>,
2020
struct_col STRUCT<field1: STRING, field2: INTEGER>
@@ -24,7 +24,7 @@ def table_fixture(self, connection_details):
2424
# Insert a record
2525
cursor.execute(
2626
"""
27-
INSERT INTO pysql_test_complex_types_table
27+
INSERT INTO pysql_e2e_test_complex_types_table
2828
VALUES (
2929
ARRAY('a', 'b', 'c'),
3030
MAP('a', 1, 'b', 2, 'c', 3),
@@ -34,7 +34,7 @@ def table_fixture(self, connection_details):
3434
)
3535
yield
3636
# Clean up the table after the test
37-
cursor.execute("DROP TABLE IF EXISTS pysql_test_complex_types_table")
37+
cursor.execute("DROP TABLE IF EXISTS pysql_e2e_test_complex_types_table")
3838

3939
@pytest.mark.parametrize(
4040
"field,expected_type",
@@ -45,7 +45,7 @@ def test_read_complex_types_as_arrow(self, field, expected_type, table_fixture):
4545

4646
with self.cursor() as cursor:
4747
result = cursor.execute(
48-
"SELECT * FROM pysql_test_complex_types_table LIMIT 1"
48+
"SELECT * FROM pysql_e2e_test_complex_types_table LIMIT 1"
4949
).fetchone()
5050

5151
assert isinstance(result[field], expected_type)
@@ -57,7 +57,7 @@ def test_read_complex_types_as_string(self, field, table_fixture):
5757
extra_params={"_use_arrow_native_complex_types": False}
5858
) as cursor:
5959
result = cursor.execute(
60-
"SELECT * FROM pysql_test_complex_types_table LIMIT 1"
60+
"SELECT * FROM pysql_e2e_test_complex_types_table LIMIT 1"
6161
).fetchone()
6262

6363
assert isinstance(result[field], str)

0 commit comments

Comments
 (0)