Spaces:
Running
Running
Commit
·
adb8925
1
Parent(s):
f0b0078
Added more conditions to ref_df check to avoid error
Browse files- tools/matcher_funcs.py +1 -1
tools/matcher_funcs.py
CHANGED
@@ -418,7 +418,7 @@ def check_ref_data_exists(Matcher:MatcherClass, ref_data_state:PandasDataFrame,
|
|
418 |
#print("Matcher reference file: ", Matcher.ref_df['Reference file'])
|
419 |
|
420 |
# Check if the source is the Addressbase places API
|
421 |
-
if len(Matcher.ref_df) > 0:
|
422 |
if Matcher.ref_df.iloc[0]['Reference file'] == 'API' or '_api_' in Matcher.ref_df.iloc[0]['Reference file']:
|
423 |
Matcher.ref_df = Matcher.ref_df.rename(columns={
|
424 |
"ORGANISATION_NAME": "Organisation",
|
|
|
418 |
#print("Matcher reference file: ", Matcher.ref_df['Reference file'])
|
419 |
|
420 |
# Check if the source is the Addressbase places API
|
421 |
+
if Matcher.ref_df is not None and len(Matcher.ref_df) > 0 and 'Reference file' in Matcher.ref_df.columns:
|
422 |
if Matcher.ref_df.iloc[0]['Reference file'] == 'API' or '_api_' in Matcher.ref_df.iloc[0]['Reference file']:
|
423 |
Matcher.ref_df = Matcher.ref_df.rename(columns={
|
424 |
"ORGANISATION_NAME": "Organisation",
|