Skip to content

Commit 611a763

Browse files
authored
fix: add anomaly_status in dbt models (#2920)
1 parent 1401f14 commit 611a763

8 files changed

Lines changed: 11 additions & 3 deletions

dbt/models/observatoire/carpool_by_day.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ LEFT JOIN
5252
WHERE
5353
a.acquisition_status = 'processed'
5454
AND a.fraud_status = 'passed'
55+
AND a.anomaly_status = 'passed'
5556
{% if is_incremental() %}
5657
AND a.start_datetime::date >= (SELECT MAX(start_date) FROM {{ this }})::date
5758
{% endif %}

dbt/models/observatoire/carpool_incentive_by_day.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ JOIN
4040
WHERE
4141
a.acquisition_status = 'processed'
4242
AND a.fraud_status = 'passed'
43+
AND a.anomaly_status = 'passed'
4344
{% if is_incremental() %}
4445
AND a.start_datetime::date >= (SELECT MAX(start_date) FROM {{ this }})::date
4546
{% endif %}

dbt/models/observatoire/carpool_newcomer_by_day.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ LEFT JOIN
4242
WHERE
4343
a.acquisition_status = 'processed'
4444
AND a.fraud_status = 'passed'
45+
AND a.anomaly_status = 'passed'
4546
{% if is_incremental() %}
4647
AND a.start_datetime::date >= (SELECT MAX(start_date) FROM {{ this }})::date
4748
{% endif %}

dbt/models/observatoire/view_carpool.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ SELECT
1212
a.passenger_payments,
1313
b.acquisition_status,
1414
b.fraud_status,
15+
b.anomaly_status,
1516
CASE
1617
WHEN
1718
c.start_geo_code::text ~ '^97[1-2]'::text
@@ -63,4 +64,4 @@ WHERE
6364
c.start_geo_code IS NOT NULL
6465
AND c.end_geo_code IS NOT NULL
6566
AND date_part('year', a.start_datetime) >= 2020
66-
AND a.start_datetime < now() - INTERVAL '8' DAY
67+
AND a.start_datetime < now() - INTERVAL '2' DAY

dbt/models/observatoire/view_distribution.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ select
2626
ON a.end_geo_code = c.old_com
2727
WHERE
2828
a.acquisition_status = 'processed'
29-
AND a.fraud_status = 'passed'
29+
AND a.fraud_status = 'passed'
30+
AND a.anomaly_status = 'passed'

dbt/models/observatoire/view_first_date_driver.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ from {{ ref('view_carpool') }}
77
where
88
acquisition_status = 'processed'
99
and fraud_status = 'passed'
10+
and anomaly_status = 'passed'
1011
group by driver_id

dbt/models/observatoire/view_first_date_passenger.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ from {{ ref('view_carpool') }}
77
where
88
acquisition_status = 'processed'
99
and fraud_status = 'passed'
10+
and anomaly_status = 'passed'
1011
group by passenger_id

dbt/models/observatoire/view_location.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ LEFT JOIN
4646
ON c.end_geo_code = e.old_com
4747
WHERE
4848
date_part('year', a.start_datetime) >= 2020
49-
AND a.start_datetime < now() - INTERVAL '8' DAY
49+
AND a.start_datetime < now() - INTERVAL '2' DAY
5050
AND b.acquisition_status = 'processed'
5151
AND b.fraud_status = 'passed'
52+
AND b.anomaly_status = 'passed'

0 commit comments

Comments
 (0)