diff --git a/src/firebolt/async_db/cursor.py b/src/firebolt/async_db/cursor.py index fbda088607c..7ff27a2fd56 100644 --- a/src/firebolt/async_db/cursor.py +++ b/src/firebolt/async_db/cursor.py @@ -303,10 +303,12 @@ def _row_set_from_response( # Skip parsing floats to properly parse them later query_data = response.json(parse_float=str) rowcount = int(query_data["rows"]) - descriptions = [ + descriptions: Optional[List[Column]] = [ Column(d["name"], parse_type(d["type"]), None, None, None, None, None) for d in query_data["meta"] ] + if not descriptions: + descriptions = None statistics = Statistics(**query_data["statistics"]) # Parse data during fetch rows = query_data["data"] diff --git a/tests/integration/dbapi/async/test_queries_async.py b/tests/integration/dbapi/async/test_queries_async.py index 7de7f7ef56d..1d64bfdb64d 100644 --- a/tests/integration/dbapi/async/test_queries_async.py +++ b/tests/integration/dbapi/async/test_queries_async.py @@ -388,9 +388,9 @@ async def test_multi_statement_query(connection: Connection) -> None: "SELECT * FROM test_tb_async_multi_statement;" "SELECT * FROM test_tb_async_multi_statement WHERE i <= 1" ) - == -1 + == 1 # Insert always returns 1 row with num of rows modified ), "Invalid row count returned for insert" - assert c.rowcount == -1, "Invalid row count" + assert c.rowcount == 1, "Invalid row count" assert c.description is None, "Invalid description" assert await c.nextset() diff --git a/tests/integration/dbapi/sync/test_queries.py b/tests/integration/dbapi/sync/test_queries.py index 5d3084c94d5..55ab830d955 100644 --- a/tests/integration/dbapi/sync/test_queries.py +++ b/tests/integration/dbapi/sync/test_queries.py @@ -333,9 +333,9 @@ def test_multi_statement_query(connection: Connection) -> None: "SELECT * FROM test_tb_multi_statement;" "SELECT * FROM test_tb_multi_statement WHERE i <= 1" ) - == -1 + == 1 # Insert always returns 1 row with num of rows modified ), "Invalid row count returned for insert" - assert c.rowcount == -1, "Invalid row count" + assert c.rowcount == 1, "Invalid row count" assert c.description is None, "Invalid description" assert c.nextset()