Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #267 +/- ##
==========================================
- Coverage 87.92% 87.47% -0.45%
==========================================
Files 56 56
Lines 4471 4560 +89
Branches 789 808 +19
==========================================
+ Hits 3931 3989 +58
- Misses 344 362 +18
- Partials 196 209 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
@yfukai, could you merge with main and resolve the conflicts? |
Contributor
Author
|
Done! |
JoOkuma
requested changes
Feb 27, 2026
| raise ValueError(f"Node {node_id} does not exist in the graph.") | ||
|
|
||
| local_node_id = self._map_to_local(node_id) | ||
| old_attrs = dict(self._graph[local_node_id]) |
Member
There was a problem hiding this comment.
Would this work?
Suggested change
| old_attrs = dict(self._graph[local_node_id]) | |
| old_attrs = self._graph[local_node_id] |
Comment on lines
+1836
to
+1838
| new_attrs_by_id = { | ||
| row[DEFAULT_ATTR_KEYS.NODE_ID]: {key: row[key] for key in attr_keys} for row in new_df.rows(named=True) | ||
| } |
Member
There was a problem hiding this comment.
Would this work? row already contains only nod_id and *attr_keys from the line above.
Suggested change
| new_attrs_by_id = { | |
| row[DEFAULT_ATTR_KEYS.NODE_ID]: {key: row[key] for key in attr_keys} for row in new_df.rows(named=True) | |
| } | |
| new_attrs_by_id = { | |
| row.pop(DEFAULT_ATTR_KEYS.NODE_ID): row for row in new_df.rows(named=True) | |
| } |
Comment on lines
+1836
to
+1838
| new_attrs_by_id = { | ||
| row[DEFAULT_ATTR_KEYS.NODE_ID]: {key: row[key] for key in attr_keys} for row in new_df.rows(named=True) | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| new_attrs_by_id = { | |
| row[DEFAULT_ATTR_KEYS.NODE_ID]: {key: row[key] for key in attr_keys} for row in new_df.rows(named=True) | |
| } | |
| new_attrs_by_id = new_df.rows_by_key(key=DEFAULT_ATTR_KEYS.NODE_ID, named=True, unique=True) |
It seems polars has a function for this, rows_by_key
This would be the preferred usage, in my opinion.
I think I have this pattern in our codebase. I'll check later if they can all be refactored to use this.
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.
Assumes #266 is merged.
Another attempt to solve #202.