Skip to content

Commit

Permalink
to_markdown() in test
Browse files Browse the repository at this point in the history
Signed-off-by: Prithvi Kannan <[email protected]>
  • Loading branch information
prithvikannan committed Oct 30, 2024
1 parent ead250d commit 4d5a8b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/databricks_ai_bridge/genie.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def poll_result():
)
if resp["status"] == "EXECUTING_QUERY":
query = next(r for r in resp["attachments"] if "query" in r)["query"]
description = query["description"]
sql = query["query"]
description = query.get("description", "")
sql = query.get("query", "")
logging.debug(f"Description: {description}")
logging.debug(f"SQL: {sql}")
return poll_query_results()
Expand Down
6 changes: 3 additions & 3 deletions tests/databricks_ai_bridge/test_genie.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_poll_for_result_executing_query(genie, mock_workspace_client):
},
]
result = genie.poll_for_result("123", "456")
assert result == pd.DataFrame().to_string()
assert result == pd.DataFrame().to_markdown()


def test_ask_question(genie, mock_workspace_client):
Expand Down Expand Up @@ -109,7 +109,7 @@ def test_parse_query_result_with_data():
"created_at": [datetime(2023, 10, 1).date(), datetime(2023, 10, 2).date()],
}
)
assert result == expected_df.to_string()
assert result == expected_df.to_markdown()


def test_parse_query_result_with_null_values():
Expand Down Expand Up @@ -138,4 +138,4 @@ def test_parse_query_result_with_null_values():
"created_at": [datetime(2023, 10, 1).date(), None],
}
)
assert result == expected_df.to_string()
assert result == expected_df.to_markdown()

0 comments on commit 4d5a8b5

Please sign in to comment.