Skip to content

Commit

Permalink
ignore failure when trying to get query runtime statistics for athena…
Browse files Browse the repository at this point in the history
… queries
  • Loading branch information
vieiralucas committed Nov 29, 2024
1 parent 84d7bcd commit 308d7ad
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/api/src/python/query/athena.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,13 @@ def briefer_make_athena_query():
print(json.dumps(result, ensure_ascii=False, default=str))
return
statistics = athena_client.get_query_runtime_statistics(QueryExecutionId=query_id)
total_rows = statistics.get("QueryRuntimeStatistics", {}).get("Rows", {}).get("OutputRows", None)
try:
statistics = athena_client.get_query_runtime_statistics(QueryExecutionId=query_id)
total_rows = statistics.get("QueryRuntimeStatistics", {}).get("Rows", {}).get("OutputRows", None)
except Exception as e:
print(json.dumps({"type": "log", "message": f"Error getting total rows: {e}"}))
total_rows = None
pass
data = athena_client.get_query_results(QueryExecutionId=query_id)
if not os.path.exists(flag_file_path):
Expand Down

0 comments on commit 308d7ad

Please sign in to comment.