Skip to content

Commit

Permalink
Fix for no records if parent sobject not found
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-balachander committed Nov 7, 2024
1 parent a64e438 commit f86f94d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cumulusci/tasks/bulkdata/select_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def similarity_generate_query(
for ref_obj, ref_fields in references.items():
fields_clause = ", ".join(ref_fields)
type_clauses.append(f"WHEN {ref_obj} THEN {fields_clause}")
type_clause = f"TYPEOF {relationship} {' '.join(type_clauses)} END"
type_clause = f"TYPEOF {relationship} {' '.join(type_clauses)} ELSE Id END"
query_fields.append(type_clause)

# Add regular fields to the query
Expand Down Expand Up @@ -206,7 +206,7 @@ def similarity_generate_query(
if "Id" not in fields:
fields.insert(0, "Id")

return query, fields # Return the original input fields with "Id"
return query, fields


def similarity_post_process(
Expand All @@ -226,9 +226,9 @@ def similarity_post_process(
closest_records = []

if complexity_constant < 1000:
closest_records = annoy_post_process(load_records, query_records)
else:
closest_records = levenshtein_post_process(load_records, query_records)
else:
closest_records = annoy_post_process(load_records, query_records)

return closest_records

Expand Down

0 comments on commit f86f94d

Please sign in to comment.