Skip to content

Commit

Permalink
misc: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aMahanna committed Jul 5, 2023
1 parent f8c2591 commit 3498133
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions adbpyg_adapter/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,28 +671,28 @@ def ntypes_to_ocollections(
return list(orphan_collections)

def __fetch_adb_docs(
self, col: str, empty_meta: bool, query_options: Any
self, col: str, meta_is_empty: bool, query_options: Any
) -> DataFrame:
"""Fetches ArangoDB documents within a collection. Returns the
documents in a DataFrame.
:param col: The ArangoDB collection.
:type col: str
:param empty_meta: Set to True if the metagraph specification
:param meta_is_empty: Set to True if the metagraph specification
for **col** is empty.
:type empty_meta: bool
:type meta_is_empty: bool
:param query_options: Keyword arguments to specify AQL query options
when fetching documents from the ArangoDB instance.
:type query_options: Any
:return: A DataFrame representing the ArangoDB documents.
:rtype: pandas.DataFrame
"""
# Only return the entire document if **empty_meta** is False
# Only return the entire document if **meta_is_empty** is False
aql = f"""
FOR doc IN @@col
RETURN {
"{ _key: doc._key, _from: doc._from, _to: doc._to }"
if empty_meta
if meta_is_empty
else "doc"
}
"""
Expand Down
4 changes: 2 additions & 2 deletions adbpyg_adapter/typings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"PyGMap",
]

from typing import Any, Callable, DefaultDict, Dict, List, Tuple, Union
from typing import Any, Callable, DefaultDict, Dict, List, Set, Tuple, Union

from pandas import DataFrame
from torch import Tensor
Expand All @@ -20,7 +20,7 @@

ADBEncoders = Dict[str, DataFrameToTensor]
ADBMetagraphValues = Union[str, DataFrameToTensor, ADBEncoders]
ADBMetagraph = Dict[str, Dict[str, Dict[str, ADBMetagraphValues]]]
ADBMetagraph = Dict[str, Dict[str, Union[Set[str], Dict[str, ADBMetagraphValues]]]]

PyGDataTypes = Union[str, Tuple[str, str, str]]
PyGMetagraphValues = Union[str, List[str], TensorToDataFrame]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ def assert_adb_to_pyg(


def assert_adb_to_pyg_meta(
meta: Union[str, Dict[str, ADBMetagraphValues]],
meta: Union[str, Set[str], Dict[str, ADBMetagraphValues]],
df: DataFrame,
pyg_data: Union[NodeStorage, EdgeStorage],
) -> None:
Expand Down

0 comments on commit 3498133

Please sign in to comment.