Spaces:
Running
Running
Commit
·
b977e79
1
Parent(s):
27640cb
Set Reference file name as '' if missing
Browse files- tools/matcher_funcs.py +7 -1
tools/matcher_funcs.py
CHANGED
@@ -366,6 +366,10 @@ def check_ref_data_exists(Matcher:MatcherClass, ref_data_state:PandasDataFrame,
|
|
366 |
if not ref_data_state.empty:
|
367 |
Matcher.ref_df = ref_data_state
|
368 |
Matcher.ref_name = get_file_name(in_ref[0].name)
|
|
|
|
|
|
|
|
|
369 |
Matcher.ref_df["Reference file"] = Matcher.ref_name
|
370 |
|
371 |
# Otherwise check for file name and load in. If nothing found, fail
|
@@ -382,6 +386,8 @@ def check_ref_data_exists(Matcher:MatcherClass, ref_data_state:PandasDataFrame,
|
|
382 |
|
383 |
else:
|
384 |
Matcher.ref_name = get_file_name(in_ref[0].name)
|
|
|
|
|
385 |
|
386 |
# Concatenate all in reference files together
|
387 |
for ref_file in in_ref:
|
@@ -420,7 +426,7 @@ def check_ref_data_exists(Matcher:MatcherClass, ref_data_state:PandasDataFrame,
|
|
420 |
# Check if the source is the Addressbase places API
|
421 |
if Matcher.ref_df is not None and len(Matcher.ref_df) > 0:
|
422 |
first_row = Matcher.ref_df.iloc[0]
|
423 |
-
print(first_row)
|
424 |
if first_row is not None and 'Reference file' in first_row:
|
425 |
if first_row['Reference file'] == 'API' or '_api_' in first_row['Reference file']:
|
426 |
Matcher.ref_df = Matcher.ref_df.rename(columns={
|
|
|
366 |
if not ref_data_state.empty:
|
367 |
Matcher.ref_df = ref_data_state
|
368 |
Matcher.ref_name = get_file_name(in_ref[0].name)
|
369 |
+
|
370 |
+
if not Matcher.ref_name:
|
371 |
+
Matcher.ref_name = ''
|
372 |
+
|
373 |
Matcher.ref_df["Reference file"] = Matcher.ref_name
|
374 |
|
375 |
# Otherwise check for file name and load in. If nothing found, fail
|
|
|
386 |
|
387 |
else:
|
388 |
Matcher.ref_name = get_file_name(in_ref[0].name)
|
389 |
+
if not Matcher.ref_name:
|
390 |
+
Matcher.ref_name = ''
|
391 |
|
392 |
# Concatenate all in reference files together
|
393 |
for ref_file in in_ref:
|
|
|
426 |
# Check if the source is the Addressbase places API
|
427 |
if Matcher.ref_df is not None and len(Matcher.ref_df) > 0:
|
428 |
first_row = Matcher.ref_df.iloc[0]
|
429 |
+
#print(first_row)
|
430 |
if first_row is not None and 'Reference file' in first_row:
|
431 |
if first_row['Reference file'] == 'API' or '_api_' in first_row['Reference file']:
|
432 |
Matcher.ref_df = Matcher.ref_df.rename(columns={
|