Fix postcode search ValueError when calculating distances
Build and Push Docker Image / build-and-push (push) Successful in 59s
Build and Push Docker Image / build-and-push (push) Successful in 59s
Use direct bracket indexing instead of .get() for pandas Series row access in calc_distance function to ensure scalar values are returned for pd.isna() checks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3c1e7b4b27
commit
e1383b3432
1 file changed
+1
-1
+1
-1
@@ -277,7 +277,7 @@ async def get_schools(
|
||||
|
||||
# Filter by distance using pre-geocoded lat/long from database
|
||||
def calc_distance(row):
|
||||
if pd.isna(row.get("latitude")) or pd.isna(row.get("longitude")):
|
||||
if pd.isna(row["latitude"]) or pd.isna(row["longitude"]):
|
||||
return float("inf")
|
||||
return haversine_distance(
|
||||
search_coords[0],
|
||||
|
||||
Reference in new issue
Block a user