Skip to content

Commit 93c3291

Browse files
kmontemayorclaude
andcommitted
test(distributed): hoist with_edge test imports to module top
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 5b2cb2e commit 93c3291

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

tests/unit/distributed/distributed_neighborloader_test.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
from parameterized import param, parameterized
99
from torch_geometric.data import Data, HeteroData
1010

11+
from gigl.distributed.base_dist_loader import BaseDistLoader
1112
from gigl.distributed.dataset_factory import build_dataset
1213
from gigl.distributed.dist_dataset import DistDataset
1314
from gigl.distributed.distributed_neighborloader import DistNeighborLoader
1415
from gigl.distributed.utils import get_free_port
16+
from gigl.distributed.utils.neighborloader import DatasetSchema
1517
from gigl.distributed.utils.serialized_graph_metadata_translator import (
1618
convert_pb_to_serialized_graph_metadata,
1719
)
@@ -26,6 +28,7 @@
2628
)
2729
from gigl.types.graph import (
2830
DEFAULT_HOMOGENEOUS_EDGE_TYPE,
31+
FeatureInfo,
2932
FeaturePartitionData,
3033
GraphPartitionData,
3134
PartitionOutput,
@@ -890,9 +893,6 @@ class WithEdgeDerivationTest(TestCase):
890893
"""Regression coverage for deriving ``with_edge`` from edge-feature presence."""
891894

892895
def test_config_with_edge_false_when_no_edge_features(self) -> None:
893-
from gigl.distributed.base_dist_loader import BaseDistLoader
894-
from gigl.distributed.utils.neighborloader import DatasetSchema
895-
896896
schema = DatasetSchema(
897897
is_homogeneous_with_labeled_edge_type=False,
898898
edge_types=None,
@@ -906,10 +906,6 @@ def test_config_with_edge_false_when_no_edge_features(self) -> None:
906906
self.assertFalse(config.with_edge)
907907

908908
def test_config_with_edge_true_when_edge_features_present(self) -> None:
909-
from gigl.distributed.base_dist_loader import BaseDistLoader
910-
from gigl.distributed.utils.neighborloader import DatasetSchema
911-
from gigl.types.graph import FeatureInfo
912-
913909
schema = DatasetSchema(
914910
is_homogeneous_with_labeled_edge_type=False,
915911
edge_types=None,
@@ -923,10 +919,6 @@ def test_config_with_edge_true_when_edge_features_present(self) -> None:
923919
self.assertTrue(config.with_edge)
924920

925921
def test_config_with_edge_true_for_heterogeneous_edge_feature_dict(self) -> None:
926-
from gigl.distributed.base_dist_loader import BaseDistLoader
927-
from gigl.distributed.utils.neighborloader import DatasetSchema
928-
from gigl.types.graph import FeatureInfo
929-
930922
schema = DatasetSchema(
931923
is_homogeneous_with_labeled_edge_type=False,
932924
edge_types=[_USER_TO_STORY, _STORY_TO_USER],

0 commit comments

Comments
 (0)