Skip to content

Commit

Permalink
Show details with connection errors (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcypher-databricks authored Jan 24, 2024
2 parents 17f6d5d + e4b803d commit 0f3c2e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fixed Hive performance regression by streamlining materialization type acquisition ([557](https://github.com/databricks/dbt-databricks/pull/557))
- Fix: Python models authentication could be overridden by a `.netrc` file in the user's home directory ([338](https://github.com/databricks/dbt-databricks/pull/338))
- Fix: MV/ST REST api authentication could be overriden by a `.netrc` file in the user's home directory ([555](https://github.com/databricks/dbt-databricks/pull/555))
- Show details in connection errors ([562](https://github.com/databricks/dbt-databricks/pull/562))
- Updated connection debugging logging and setting connection last used time on session open.([565](https://github.com/databricks/dbt-databricks/pull/565))

### Under the Hood
Expand Down
10 changes: 7 additions & 3 deletions dbt/adapters/databricks/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,7 @@ def _get_table_view_pipeline_id(session: Session, host: str, name: str) -> str:
resp1 = session.get(table_url)
if resp1.status_code != 200:
raise dbt.exceptions.DbtRuntimeError(
f"Error getting info for materialized view/streaming table: {name}"
f"Error getting info for materialized view/streaming table {name}: {resp1.text}"
)

pipeline_id = resp1.json().get("pipeline_id", "")
Expand All @@ -1526,7 +1526,9 @@ def _get_pipeline_state(session: Session, host: str, pipeline_id: str) -> dict:

response = session.get(pipeline_url)
if response.status_code != 200:
raise dbt.exceptions.DbtRuntimeError(f"Error getting pipeline info: {pipeline_id}")
raise dbt.exceptions.DbtRuntimeError(
f"Error getting pipeline info for {pipeline_id}: {response.text}"
)

return response.json()

Expand All @@ -1552,7 +1554,9 @@ def _get_update_error_msg(session: Session, host: str, pipeline_id: str, update_
events_url = f"https://{host}/api/2.0/pipelines/{pipeline_id}/events"
response = session.get(events_url)
if response.status_code != 200:
raise dbt.exceptions.DbtRuntimeError(f"Error getting pipeline event info: {pipeline_id}")
raise dbt.exceptions.DbtRuntimeError(
f"Error getting pipeline event info for {pipeline_id}: {response.text}"
)

events = response.json().get("events", [])
update_events = [
Expand Down

0 comments on commit 0f3c2e6

Please sign in to comment.