Skip to content

Commit bbe9bb3

Browse files
authored
Merge pull request #2563 from LBHackney-IT/daroclark-patch-1
Update rentsense_former_tenants_to_refined.py
2 parents 1204282 + 9ae5b90 commit bbe9bb3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

scripts/jobs/rentsense_former_tenants_to_refined.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
current_date,
1717
date_format,
1818
date_sub,
19+
datediff,
1920
lit,
2021
substring,
2122
to_date,
2223
to_timestamp,
23-
datediff,
2424
when,
2525
)
2626
from pyspark.sql.window import Window
27+
2728
from scripts.helpers.helpers import (
2829
PARTITION_KEYS,
2930
add_import_time_columns,
@@ -575,7 +576,7 @@ def export_dynamic_frame_as_xml_gzip(
575576
)
576577
)
577578
accounts_int = accounts.where(
578-
col("description").isin({"Introductory", "Mense Profit Ac"})
579+
col("description").isin({"Introductory", "Mense Profit Ac", "Mesne Profit Ac"})
579580
)
580581
accounts_int = accounts_int.join(
581582
accounts_s,
@@ -665,7 +666,7 @@ def export_dynamic_frame_as_xml_gzip(
665666
"AgreementCode as ArrangementCode",
666667
# "initial_payment_date as FirstInstallmentDueDate",
667668
# "AgreementCreatedDate",
668-
"Amount as PaymentAmount"
669+
"Amount as PaymentAmount",
669670
# "uh_ten_ref as TenReference",
670671
# "import_date"
671672
)
@@ -771,7 +772,7 @@ def export_dynamic_frame_as_xml_gzip(
771772
# "Address3",
772773
"PostCode as PropertyPostCode",
773774
"Email as PrimaryEmailAddress",
774-
"'' as SecondaryEmailAddress"
775+
"'' as SecondaryEmailAddress",
775776
# "PropertyType",
776777
# "uh_ten_ref as TenReference",
777778
# "import_date"
@@ -817,7 +818,7 @@ def export_dynamic_frame_as_xml_gzip(
817818
balances = balances.selectExpr(
818819
"paymentreference as AccountReference",
819820
"previousweekbalance as CurrentBalance",
820-
"BalanceDate"
821+
"BalanceDate",
821822
# "uh_ten_ref as TenReference",
822823
# "import_date"
823824
)
@@ -1055,7 +1056,7 @@ def export_dynamic_frame_as_xml_gzip(
10551056
"iso8601_format as TransactionPostDate",
10561057
"trans_type as TransactionCode",
10571058
"real_value as TransactionAmount",
1058-
"code_lookup as TransactionDescription"
1059+
"code_lookup as TransactionDescription",
10591060
# "uh_ten_ref as TenReference",
10601061
# "import_date"
10611062
)

0 commit comments

Comments
 (0)