Skip to content

Commit 5d964d3

Browse files
committed
fix bug when pipeline is executed without any manual matches
1 parent 2a35e79 commit 5d964d3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/server/pipeline/clean_and_load_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
def start(connection, pdp_contacts_df, file_path_list):
1414
result = pd.DataFrame(columns=pdp_contacts_df.columns)
1515
json_rows = pd.DataFrame(columns=["source_type", "source_id", "json"])
16-
manual_matches_df = None
16+
manual_matches_df = pd.DataFrame()
1717

1818
for uploaded_file in file_path_list:
1919
file_path = os.path.join(CURRENT_SOURCE_FILES_PATH, uploaded_file)

src/server/pipeline/match_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ def start(connection, added_or_updated_rows, manual_matches_df):
7272
)
7373
]
7474
#collect other linked ids from manual matches source
75-
if manual_matches_df != None:
75+
if not manual_matches_df.empty:
7676
linked_ids = manual_matches_df[(manual_matches_df[row["source_type"]] == row["source_id"])]
7777
ids = linked_ids.to_dict(orient="records")
78-
for row_dict in enumerate(ids):
78+
for id_num, row_dict in enumerate(ids):
7979
for column, value in row_dict.items():
8080
row_matches = row_matches.append(pdp_contacts[(pdp_contacts["source_type"] == column) & (pdp_contacts["source_id"] == value)])
81-
81+
8282

8383
if row_matches.empty: # new record, no matching rows
8484
max_matching_group += 1

0 commit comments

Comments
 (0)