|
29 | 29 | node_attr_dict_factory, |
30 | 30 | node_dict_factory, |
31 | 31 | ) |
32 | | -from .function import cast_to_string, get_node_id |
| 32 | +from .function import get_node_id |
33 | 33 | from .reportviews import ArangoEdgeView, ArangoNodeView |
34 | 34 |
|
35 | 35 | networkx_api = nxadb.utils.decorators.networkx_class(nx.Graph) # type: ignore |
@@ -614,24 +614,6 @@ def chat( |
614 | 614 |
|
615 | 615 | return str(response["result"]) |
616 | 616 |
|
617 | | - def _get_smart_id(self, node_for_adding: str, attr: dict[Any, Any]) -> str: |
618 | | - raise NotImplementedError( |
619 | | - "This is broken if node_for_adding is structured like an ArangoDB ID" |
620 | | - ) # noqa: E501 |
621 | | - # Should we really be doing this? Database would catch this error anyways... |
622 | | - |
623 | | - if self.smart_field not in attr: |
624 | | - m = f"Node {node_for_adding} missing smart field '{self.smart_field}'" # noqa: E501 |
625 | | - raise KeyError(m) |
626 | | - |
627 | | - # TODO: Revisit this behaviour. |
628 | | - # Too magical? Raise error instead? Let ArangoDB handle it? |
629 | | - node_for_adding = cast_to_string(node_for_adding) |
630 | | - if ":" not in node_for_adding: |
631 | | - node_for_adding = f"{attr[self.smart_field]}:{node_for_adding}" |
632 | | - |
633 | | - return node_for_adding |
634 | | - |
635 | 617 | ##################### |
636 | 618 | # nx.Graph Overides # |
637 | 619 | ##################### |
@@ -699,15 +681,6 @@ def add_node_override(self, node_for_adding, **attr): |
699 | 681 | if node_for_adding is None: |
700 | 682 | raise ValueError("None cannot be a node") |
701 | 683 |
|
702 | | - # New: |
703 | | - # if self.is_smart: |
704 | | - # node_for_adding = self._get_smart_id(node_for_adding, attr) |
705 | | - |
706 | | - # Reason: |
707 | | - # Support for ArangoDB Smart Graphs requires the smart field |
708 | | - # to be set before adding the node to the graph. This is because |
709 | | - # the smart field is used to generate the node's key. |
710 | | - |
711 | 684 | if node_for_adding not in self._node: |
712 | 685 | self._adj[node_for_adding] = self.adjlist_inner_dict_factory() |
713 | 686 |
|
|
0 commit comments