Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-ho committed Feb 23, 2024
1 parent e4745c9 commit d0a9eef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions daft/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 127 in daft/utils.py

View check run for this annotation

Codecov / codecov/patch

daft/utils.py#L122-L127

Added lines #L122 - L127 were not covered by tests


def execute_sql_query_to_pyarrow_with_sqlalchemy(sql: str, url: str) -> pa.Table:
Expand All @@ -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

Check warning on line 142 in daft/utils.py

View check run for this annotation

Codecov / codecov/patch

daft/utils.py#L134-L142

Added lines #L134 - L142 were not covered by tests


def execute_sql_query_to_pyarrow(sql: str, url: str) -> pa.Table:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/sql/test_sql_lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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://")

0 comments on commit d0a9eef

Please sign in to comment.