From c2f29e86dfd5658dd6979b4da0b91a541814ff00 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Thu, 12 Feb 2026 15:11:20 +0000 Subject: [PATCH] made tests pass and redploy --- .github/workflows/deploy_terraform.yml | 3 +++ backend/address2UPRN/main.py | 17 ++++++++--------- backend/postcode_splitter/main.py | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index e8e82edf..90595632 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -204,3 +204,6 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} AWS_REGION: ${{ secrets.DEV_AWS_REGION }} + + + diff --git a/backend/address2UPRN/main.py b/backend/address2UPRN/main.py index e635b305..f4aa0dc9 100644 --- a/backend/address2UPRN/main.py +++ b/backend/address2UPRN/main.py @@ -329,6 +329,7 @@ def get_uprn_candidates( def get_uprn_with_epc_df( user_inputed_address: str, epc_df: pd.DataFrame, + verbose=False, ): """ Return uprn (str) using a pre-fetched EPC dataframe. @@ -377,15 +378,16 @@ def get_uprn_with_epc_df( if found_uprn == "": return None - return (found_uprn, address, score) + if verbose: + return (found_uprn, address, score) + else: + return found_uprn def get_uprn( user_inputed_address: str, postcode: str, - return_address=False, - return_EPC=False, - return_score=True, + verbose=False, ): """ Return uprn (str) @@ -400,9 +402,7 @@ def get_uprn( return get_uprn_with_epc_df( user_inputed_address=user_inputed_address, epc_df=df, - return_address=return_address, - return_EPC=return_EPC, - return_score=return_score, + verbose=verbose, ) @@ -727,8 +727,7 @@ def handler(event, context, local=False): # Get UPRN using the pre-fetched EPC data with all return options result = get_uprn_with_epc_df( - user_inputed_address=user_input, - epc_df=epc_df, + user_inputed_address=user_input, epc_df=epc_df, verbose=True ) # Parse result tuple if successful diff --git a/backend/postcode_splitter/main.py b/backend/postcode_splitter/main.py index 73a79d2c..8c0048e2 100644 --- a/backend/postcode_splitter/main.py +++ b/backend/postcode_splitter/main.py @@ -168,7 +168,7 @@ def handler(event, context, local=False): # TODO: DELETE ME, if you see this in the PR. # TODO: DELETE ME, if you see this in the PR. # TODO: DELETE ME, if you see this in the PR. - df = df.head(5) + df = df.head(1983) logger.info(f"CSV loaded: {len(df)} rows, {len(df.columns)} columns")