-
Notifications
You must be signed in to change notification settings - Fork 4
GA-157 | Review #18
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
GA-157 | Review #18
Conversation
for k, v in result.items(): | ||
self.data[k] = self.__process_graph_dict_value(k, v) | ||
|
||
def __process_graph_dict_value(self, key: str, value: Any) -> Any: |
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.
introduced this private method to process any value
that would be added to GraphDict
. Similar to process_graph_attr_dict_value
, but without the concept of parent_keys
and root
if value := self.data.get(key): | ||
return value | ||
assert self.graph_id |
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.
removing any need for graph_id
assertions as you were able to make use of the factory method to set graph_id
return result | ||
return graph_attr_dict_value |
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.
returning the graph_attr_dict_value
to maintain any remote connection (if result
is of type dict
)
@@ -359,7 +363,6 @@ def process_node_attr_dict_value(parent: NodeAttrDict, key: str, value: Any) -> | |||
|
|||
node_attr_dict = parent.node_attr_dict_factory() | |||
node_attr_dict.root = parent.root or parent | |||
# TODO: Check if node_id can be passes by reference |
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.
turns out this is already the case, my bad:
a = "hello world"
b = a
print(id(a) == id(b))
* moved tests, added root to G dict * all tests green * format, lint * fix a todo, fix flake * fix potential path that could be hit in case data structure is in unexpected state * use incr update instead * fixed missing parameter * added code suggestions, fixed update method in GraphDict which caused trouble * fix method signature * flake8 * do not clear remote data if clear() is being called * fmt * GA-157 | review (#18) --------- Co-authored-by: Anthony Mahanna <[email protected]>
No description provided.