Skip to content

Commit

Permalink
Fix error of no result at all
Browse files Browse the repository at this point in the history
Fixes POSTHOG-TMM
  • Loading branch information
webjunkie committed Apr 26, 2024
1 parent f1a3920 commit 35b9ade
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions posthog/tasks/exports/test/csv_renders/hogql_no_result.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"csv_rows": ["error", "No data available or unable to format for export.", ""],
"response": {
"columns": null,
"hasMore": null
}
}
4 changes: 3 additions & 1 deletion posthog/tasks/exports/test/test_csv_exporter_renders.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ def test_csv_rendering(mock_settings, mock_process_query, mock_request, filename
elif fixture["response"].get("results") is not None:
mock_process_query.return_value = fixture["response"]
else:
mock_process_query.return_value = {"results": fixture["response"].pop("result"), **fixture["response"]}
mock_process_query.return_value = fixture["response"]
if "result" in fixture["response"]:
mock_process_query.return_value["results"] = fixture["response"].pop("result")
csv_exporter.export_tabular(asset)
csv_rows = asset.content.decode("utf-8").split("\r\n")

Expand Down

0 comments on commit 35b9ade

Please sign in to comment.