Alealejandrooo commited on
Commit
f9febf1
1 Parent(s): af22e18

Update process.py

Browse files
Files changed (1) hide show
  1. process.py +2 -2
process.py CHANGED
@@ -24,7 +24,7 @@ def get_lat_lon(postcodes_df, postcode_mapping):
24
  # Attempt to identify the postcode column dynamically
25
  postcode_column = find_postcode_column(postcodes_df)
26
  if not postcode_column:
27
- raise ValueError("No valid postcode column found")
28
 
29
  # Rename columns for consistency
30
  postcode_mapping.rename(columns={'postcode': 'Postal code'}, inplace=True)
@@ -48,6 +48,6 @@ def get_lat_lon(postcodes_df, postcode_mapping):
48
  results = result_df.to_dict(orient='records')
49
 
50
  except Exception as e:
51
- raise Exception("Error processing postal codes: " + str(e))
52
 
53
  return results
 
24
  # Attempt to identify the postcode column dynamically
25
  postcode_column = find_postcode_column(postcodes_df)
26
  if not postcode_column:
27
+ raise gr.Error("No valid postcode column found")
28
 
29
  # Rename columns for consistency
30
  postcode_mapping.rename(columns={'postcode': 'Postal code'}, inplace=True)
 
48
  results = result_df.to_dict(orient='records')
49
 
50
  except Exception as e:
51
+ raise gr.Error("Error processing postal codes: " + str(e))
52
 
53
  return results