-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Log more expressive errors for missing child links #381
chore: Log more expressive errors for missing child links #381
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great ! Just a suggestion of an improvement that we can do.
for lc, lc_child_links in lc_child_links_map.items(): | ||
# we collect all the tags_ids in a certain language | ||
tags_ids = set() | ||
for node in entry_nodes: | ||
if "tags_ids_" + lc in node.tags: | ||
tags_ids.update(node.tags["tags_ids_" + lc]) | ||
|
||
# we check if the parent_id exists in the tags_ids | ||
for child_link in lc_child_links: | ||
if child_link["parent_id"] not in tags_ids: | ||
missing_child_links.append((lc, child_link)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good implementation, but it seems of a pity that we do not make the most of this computation.
If, instead of a set, tags_ids is a dict mapping tags_ids to their canonical id, it still can be used to check for existence, but we can also retrieve the real parent at the same cost.
This will simplify (and improve performance on) parent links creation in the graph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes good idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect !
What
Screenshot
Fixes bug(s)