AJAY KASU commited on
Commit
2471c97
·
1 Parent(s): 132848a

Fix: Refine COLUMN_MAP to avoid duplicate customer_id labels

Browse files
Files changed (1) hide show
  1. modules/etl.py +5 -11
modules/etl.py CHANGED
@@ -6,32 +6,26 @@ COLUMN_MAP = {
6
  # transaction_id variants
7
  "tx_id": "transaction_id",
8
  "txn_id": "transaction_id",
9
- "trans_id": "transaction_id",
10
- "id": "transaction_id",
11
 
12
- # customer_id variants
13
- "sender_account_id": "customer_id",
14
- "receiver_account_id": "customer_id",
15
  "account_id": "customer_id",
16
  "cust_id": "customer_id",
17
- "user_id": "customer_id",
 
 
18
 
19
  # amount variants
20
  "tx_amount": "amount",
21
  "txn_amount": "amount",
22
- "trans_amount": "amount",
23
- "value": "amount",
24
 
25
  # timestamp variants
26
- "date": "timestamp",
27
- "datetime": "timestamp",
28
  "transaction_date": "timestamp",
29
  "tx_date": "timestamp",
30
 
31
  # transaction_type variants
32
  "tx_type": "transaction_type",
33
  "txn_type": "transaction_type",
34
- "trans_type": "transaction_type",
35
  "type": "transaction_type",
36
  }
37
 
 
6
  # transaction_id variants
7
  "tx_id": "transaction_id",
8
  "txn_id": "transaction_id",
 
 
9
 
10
+ # customer_id — ONLY map sender, not receiver
11
+ "sender_account_id": "customer_id", # ← sender is the customer
 
12
  "account_id": "customer_id",
13
  "cust_id": "customer_id",
14
+
15
+ # Keep receiver separate — DO NOT map to customer_id
16
+ # "receiver_account_id" stays as receiver_account_id
17
 
18
  # amount variants
19
  "tx_amount": "amount",
20
  "txn_amount": "amount",
 
 
21
 
22
  # timestamp variants
 
 
23
  "transaction_date": "timestamp",
24
  "tx_date": "timestamp",
25
 
26
  # transaction_type variants
27
  "tx_type": "transaction_type",
28
  "txn_type": "transaction_type",
 
29
  "type": "transaction_type",
30
  }
31