Open
Conversation
Closed
Comment on lines
+40
to
+50
| def validate_max_labels_per_anchor_node( | ||
| max_labels_per_anchor_node: Optional[int], | ||
| ) -> Optional[int]: | ||
| """Validate the optional per-anchor label cap.""" | ||
| if max_labels_per_anchor_node is None: | ||
| return None | ||
| if max_labels_per_anchor_node <= 0: | ||
| raise ValueError( | ||
| "max_labels_per_anchor_node must be a positive integer when provided." | ||
| ) | ||
| return max_labels_per_anchor_node |
Collaborator
There was a problem hiding this comment.
I'm not sure this provides a ton of value (and returning from a "check" seems weird, It should probably just always return none and throw an error fi there's a problem?)
Comment on lines
+693
to
+695
| max_labels_per_anchor_node = validate_max_labels_per_anchor_node( | ||
| max_labels_per_anchor_node | ||
| ) |
Collaborator
There was a problem hiding this comment.
I think we're probably calling this function too much, it really only need to be called here right?
I'm not sure it's super useful to call it everywhere when this is the only place it actually gets used, and otherwise it makes our code more complicated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope of work done
In previous experiments, for non user defined labels where labels are generated from 1 hop, we need to enable limiting num max labels per anchor to reduce blow up in memory.
This PR updates to include the option through configs to limit max mum labels per anchor.
Where is the documentation for this feature?: N/A
Did you add automated tests or write a test plan?
Updated Changelog.md? NO
Ready for code review?: NO