From 2ed246cb61b8625ed1ef65483763d7fb37ca4a93 Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Mon, 20 Dec 2021 14:03:24 -0500 Subject: [PATCH] Fix a problem with the events_table analytics collectors The switch to using jsonb objects instead of json broke the use of json_to_record in the raw sql in the _events_table function. --- awx/main/analytics/collectors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/analytics/collectors.py b/awx/main/analytics/collectors.py index ad277e248e..9fd8005a91 100644 --- a/awx/main/analytics/collectors.py +++ b/awx/main/analytics/collectors.py @@ -356,7 +356,7 @@ def _events_table(since, full_path, until, tbl, where_column, project_job_create x.duration AS duration, x.res->'warnings' AS warnings, x.res->'deprecations' AS deprecations - FROM {tbl}, json_to_record({event_data}) AS x("res" json, "duration" text, "task_action" text, "start" text, "end" text) + FROM {tbl}, jsonb_to_record({event_data}) AS x("res" json, "duration" text, "task_action" text, "start" text, "end" text) WHERE ({tbl}.{where_column} > '{since.isoformat()}' AND {tbl}.{where_column} <= '{until.isoformat()}')) TO STDOUT WITH CSV HEADER''' return query