From df5091e9b70419c46b8ef8ff99fb97a3fde03f7d Mon Sep 17 00:00:00 2001 From: Guilherme Botelho Date: Fri, 13 Sep 2024 12:53:33 -0300 Subject: [PATCH] fix order by jinja (#220) --- pipelines/migration/projeto_subsidio_sppo/flows.py | 2 +- queries/models/projeto_subsidio_sppo/viagem_planejada.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelines/migration/projeto_subsidio_sppo/flows.py b/pipelines/migration/projeto_subsidio_sppo/flows.py index db93c0d5..ede4005a 100644 --- a/pipelines/migration/projeto_subsidio_sppo/flows.py +++ b/pipelines/migration/projeto_subsidio_sppo/flows.py @@ -3,7 +3,7 @@ """ Flows for projeto_subsidio_sppo -DBT 2024-09-10 +DBT 2024-09-13 """ from prefect import Parameter, case, task diff --git a/queries/models/projeto_subsidio_sppo/viagem_planejada.sql b/queries/models/projeto_subsidio_sppo/viagem_planejada.sql index db08c4bb..a8b01f59 100644 --- a/queries/models/projeto_subsidio_sppo/viagem_planejada.sql +++ b/queries/models/projeto_subsidio_sppo/viagem_planejada.sql @@ -199,7 +199,7 @@ and {% else %} {% if execute %} - {% set result = run_query("SELECT tipo_os, feed_version, feed_start_date, tipo_dia FROM " ~ ref('subsidio_data_versao_efetiva') ~ " WHERE data BETWEEN DATE_SUB(DATE('" ~ var("run_date") ~ "'), INTERVAL 2 DAY) AND DATE_SUB(DATE('" ~ var("run_date") ~ "'), INTERVAL 1 DAY) ORDER BY feed_version") %} + {% set result = run_query("SELECT tipo_os, feed_version, feed_start_date, tipo_dia FROM " ~ ref('subsidio_data_versao_efetiva') ~ " WHERE data BETWEEN DATE_SUB(DATE('" ~ var("run_date") ~ "'), INTERVAL 2 DAY) AND DATE_SUB(DATE('" ~ var("run_date") ~ "'), INTERVAL 1 DAY) ORDER BY data") %} {% set tipo_oss = result.columns[0].values() %} {% set feed_versions = result.columns[1].values() %} {% set feed_start_dates = result.columns[2].values() %}