Skip to content

Commit 74204a5

Browse files
authored
Update Parking_interim_cycle_hangar_waiting_list.py
change where date because data is a day old?? Also change parking_parking_cycle_hangar_unsubscribed_emails table name to parking_cycle_hangar_unsubscribed_emails
1 parent 6ad31da commit 74204a5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scripts/jobs/parking/Parking_interim_cycle_hangar_waiting_list.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@
4444
/*** Obtain the llpg data ***/
4545
FULL_LLPG as (
4646
SELECT * From "parking-refined-zone".spatially_enriched_liberator_permit_llpg
47-
WHERE import_Date = format_datetime(current_date, 'yyyyMMdd')
47+
WHERE import_date = (select max(import_date)
48+
from "parking-refined-zone".spatially_enriched_liberator_permit_llpg)
4849
AND address1 not like '%STREET RECORD%'),
4950
5051
STREET_LLPG as (
5152
SELECT * From "parking-refined-zone".spatially_enriched_liberator_permit_llpg
52-
WHERE import_Date = format_datetime(current_date, 'yyyyMMdd')
53+
WHERE import_date = (select max(import_date)
54+
from "parking-refined-zone".spatially_enriched_liberator_permit_llpg)
5355
AND address1 like '%STREET RECORD%'),
5456
5557
/*** Obtain the Party details, where available ***/
@@ -63,8 +65,9 @@
6365
unsubscribed_emails as (
6466
SELECT *,
6567
ROW_NUMBER() OVER ( PARTITION BY email_address ORDER BY email_address DESC) row1
66-
FROM "parking-raw-zone".parking_parking_cycle_hangar_unsubscribed_emails
67-
WHERE import_Date = format_datetime(current_date, 'yyyyMMdd'))
68+
FROM "parking-raw-zone".parking_cycle_hangar_unsubscribed_emails
69+
WHERE import_date = (select max(import_date)
70+
from "parking-raw-zone".parking_cycle_hangar_unsubscribed_emails))
6871
6972
SELECT
7073
A.*, cast(D.telephone_number as varchar) as Telephone_Number, C.address2 as Street, B.housing_estate, E.email_address,

0 commit comments

Comments
 (0)