From ea9c592187fda540463e99c8595c07788b221698 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 17:24:26 +0000 Subject: [PATCH] refactor(graph_learners): replace wildcard imports with explicit imports Replace wildcard imports from graph_operations with explicit imports of the required symbols (adjacency_matrix_to_graph, str_to_dot). This improves code clarity, makes dependencies explicit, and enables better static analysis and import ordering. Changes: - GES: add explicit numpy import - CDT: add explicit networkx and numpy imports - LINGAM: add explicit numpy import No functional changes; all three modules now have clear visibility into their dependencies. Signed-off-by: github-actions[bot] --- dowhy/graph_learners/cdt.py | 5 ++++- dowhy/graph_learners/ges.py | 4 +++- dowhy/graph_learners/lingam.py | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dowhy/graph_learners/cdt.py b/dowhy/graph_learners/cdt.py index 8c96a42f7f..fb654bd020 100644 --- a/dowhy/graph_learners/cdt.py +++ b/dowhy/graph_learners/cdt.py @@ -1,5 +1,8 @@ +import networkx as nx +import numpy as np + from dowhy.graph_learners import GraphLearner -from dowhy.utils.graph_operations import * +from dowhy.utils.graph_operations import adjacency_matrix_to_graph, str_to_dot from . import get_library_class_object diff --git a/dowhy/graph_learners/ges.py b/dowhy/graph_learners/ges.py index 043b91ccfe..1f31d35d28 100644 --- a/dowhy/graph_learners/ges.py +++ b/dowhy/graph_learners/ges.py @@ -1,7 +1,9 @@ from importlib import import_module +import numpy as np + from dowhy.graph_learners import GraphLearner -from dowhy.utils.graph_operations import * +from dowhy.utils.graph_operations import adjacency_matrix_to_graph, str_to_dot class GES(GraphLearner): diff --git a/dowhy/graph_learners/lingam.py b/dowhy/graph_learners/lingam.py index a6c4cb8713..47860164dc 100644 --- a/dowhy/graph_learners/lingam.py +++ b/dowhy/graph_learners/lingam.py @@ -1,5 +1,7 @@ +import numpy as np + from dowhy.graph_learners import GraphLearner -from dowhy.utils.graph_operations import * +from dowhy.utils.graph_operations import adjacency_matrix_to_graph, str_to_dot from . import get_library_class_object