Skip to content

Commit

Permalink
add more verbose exception message when we get wrong root cres
Browse files Browse the repository at this point in the history
  • Loading branch information
northdpole committed Nov 20, 2024
1 parent 5717e0f commit 6176ad7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions application/utils/spreadsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ def generate_mapping_template_file(
) -> str:
maxOffset = 0
related = set()

def add_offset_cre(
cre: defs.CRE, database: db.Node_collection, offset: int, visited_cres: Set
) -> List[Dict[str, str]]:
Expand Down Expand Up @@ -345,11 +344,10 @@ def add_offset_cre(
result[0]["standard|id"] = ""
result[0]["standard|hyperlink"] = ""
result.extend(csv)

orphaned_documents = [doc for doc in related if doc not in visited_cres]
if len(orphaned_documents):
raise ValueError(
"found CREs with only related links not provided in the root_cre list, unless you are really sure for this use case, this is a bug"
f"found CREs '{orphaned_documents}' with only related links not provided in the root_cre list, unless you are really sure for this use case, this is a bug"
)

return result

0 comments on commit 6176ad7

Please sign in to comment.