Skip to content

Commit

Permalink
Merge pull request DataJunction#17 from DataJunction/fix_druid
Browse files Browse the repository at this point in the history
fix: druid
  • Loading branch information
betodealmeida committed Jan 8, 2022
2 parents c9820de + 4501849 commit 979dacb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/datajunction/cli/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ def get_columns(table: Table) -> List[Column]:
table.table,
schema=table.schema_,
)
except Exception as ex: # pylint: disable=broad-except
except Exception: # pylint: disable=broad-except
# Druid currently doesn't work with SQLAlchemy 1.4, and raises an exception. Once
# we've merged https://github.com/druid-io/pydruid/pull/275 we can modify this to
# re-raise the exception.
_logger.exception("Unable to get table metadata")
raise ex
return []

return [
Column(
Expand Down
4 changes: 1 addition & 3 deletions tests/cli/compile_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ def test_get_columns_error(mocker: MockerFixture) -> None:
)

table = mocker.MagicMock()
with pytest.raises(Exception) as excinfo:
get_columns(table)
assert str(excinfo.value) == "An unexpected error occurred"
assert get_columns(table) == []


@pytest.mark.asyncio
Expand Down

0 comments on commit 979dacb

Please sign in to comment.