Skip to content

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

Merged
merged 1 commit into from
Aug 2, 2024
Merged

GA-157 | Review #18

merged 1 commit into from
Aug 2, 2024

Conversation

aMahanna
Copy link
Member

@aMahanna aMahanna commented Aug 1, 2024

No description provided.

@aMahanna aMahanna changed the base branch from main to feat/GA-157 August 1, 2024 23:32
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:
Copy link
Member Author

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
Copy link
Member Author

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

Comment on lines -313 to +314
return result
return graph_attr_dict_value
Copy link
Member Author

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
Copy link
Member Author

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))

@aMahanna aMahanna requested a review from hkernbach August 1, 2024 23:42
@aMahanna aMahanna merged commit 36a9d0d into feat/GA-157 Aug 2, 2024
2 checks passed
@aMahanna aMahanna deleted the GA-157-review branch August 2, 2024 14:03
aMahanna added a commit that referenced this pull request Aug 2, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants