cleaning up inputs

This commit is contained in:
Khalim Conn-Kowlessar 2026-03-25 23:51:42 +00:00
parent 2da419df71
commit a3081214ca

View file

@ -4,6 +4,7 @@ from copy import deepcopy
from datetime import datetime
import pandas as pd
from uuid import UUID
from typing import List
from tqdm import tqdm
from sqlalchemy.exc import IntegrityError, OperationalError
@ -375,14 +376,13 @@ def get_funding_data():
return project_scores_matrix, partial_project_scores_matrix, whlg_eligible_postcodes
def check_duplicate_uprns(plan_input):
def check_duplicate_uprns(input_uprns: List[int]):
"""
Simple function to check if the input data contains duplicated UPRNS.
If there are duplicates, an exception will be rasied
:return:
"""
# Check for duplicate UPRNS
input_uprns = [x.get("uprn") for x in plan_input if "uprn" in x and x.get("uprn")]
if input_uprns:
# Check for dupes