From d0a9eefc4c60550f9cb47e545d8002c7a1c77da2 Mon Sep 17 00:00:00 2001 From: Colin Ho Date: Fri, 23 Feb 2024 11:15:35 -0800 Subject: [PATCH] fix test --- daft/utils.py | 4 ++-- tests/integration/sql/test_sql_lite.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/daft/utils.py b/daft/utils.py index 2791826613..640eb07655 100644 --- a/daft/utils.py +++ b/daft/utils.py @@ -124,7 +124,7 @@ def execute_sql_query_to_pyarrow_with_connectorx(sql: str, url: str) -> pa.Table table = cx.read_sql(conn=url, query=sql, return_type="arrow") return table except Exception as e: - raise RuntimeError(f"Failed to execute sql: {sql} with url: {url}") from e + raise RuntimeError(f"Failed to execute sql: {sql} with url: {url}, error: {e}") from e def execute_sql_query_to_pyarrow_with_sqlalchemy(sql: str, url: str) -> pa.Table: @@ -139,7 +139,7 @@ def execute_sql_query_to_pyarrow_with_sqlalchemy(sql: str, url: str) -> pa.Table table = pa.Table.from_pandas(df) return table except Exception as e: - raise RuntimeError(f"Failed to execute sql: {sql} with url: {url}") from e + raise RuntimeError(f"Failed to execute sql: {sql} with url: {url}, error: {e}") from e def execute_sql_query_to_pyarrow(sql: str, url: str) -> pa.Table: diff --git a/tests/integration/sql/test_sql_lite.py b/tests/integration/sql/test_sql_lite.py index 8670b49e3f..0b4e1b5ed8 100644 --- a/tests/integration/sql/test_sql_lite.py +++ b/tests/integration/sql/test_sql_lite.py @@ -145,5 +145,5 @@ def test_sqllite_read_with_all_pushdowns(temp_sqllite_db) -> None: @pytest.mark.integration() def test_sqllite_bad_url() -> None: - with pytest.raises(RuntimeError, match="Unable to execute sql"): + with pytest.raises(RuntimeError, match="Failed to execute sql"): daft.read_sql("SELECT * FROM iris", "sqlite://")