Skip to content

[Repo Assist] refactor(graph_learners): replace wildcard imports with explicit imports - #1815

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/fix-wildcard-imports-20260915-a1b13d2b6163a46d
Open

github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/fix-wildcard-imports-20260915-a1b13d2b6163a46d

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is an automated response from Repo Assist.

Summary

Improved code clarity by replacing wildcard imports from graph_operations with explicit imports of required symbols in the graph learner modules (GES, CDT, LINGAM). This is a coding improvement for better maintainability and static analysis.

Changes

  • GES (dowhy/graph_learners/ges.py):

    • Added explicit import numpy as np
    • Replaced from dowhy.utils.graph_operations import * with explicit imports of adjacency_matrix_to_graph and str_to_dot
  • CDT (dowhy/graph_learners/cdt.py):

    • Added explicit import networkx as nx and import numpy as np
    • Replaced wildcard import with explicit imports of adjacency_matrix_to_graph and str_to_dot
  • LINGAM (dowhy/graph_learners/lingam.py):

    • Added explicit import numpy as np
    • Replaced wildcard import with explicit imports of adjacency_matrix_to_graph and str_to_dot

Rationale

Wildcard imports obscure dependencies and make static analysis harder. Explicit imports clarify what symbols each module depends on, improving code maintainability and enabling better import ordering tools (isort, black).

Test Status

✅ Python syntax validation passed for all three modified files

  • No functional changes; all modules retain identical behavior
  • Changes align with DoWhy coding standards (explicit imports, clear dependencies)

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@11c9a2c442e519ff2b427bf58679f5a525353f76

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] <github-actions[bot]@users.noreply.github.com>
@emrekiciman
emrekiciman marked this pull request as ready for review September 16, 2026 06:47
@emrekiciman
emrekiciman requested a balanced review from Copilot September 16, 2026 06:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Refactors graph learner modules to improve clarity and static analysis by replacing wildcard imports from dowhy.utils.graph_operations with explicit symbol imports.

Changes:

  • Replaced from dowhy.utils.graph_operations import * with adjacency_matrix_to_graph and str_to_dot imports in GES/CDT/LiNGAM.
  • Added explicit third-party imports (numpy, networkx) where needed to avoid implicit dependencies.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
dowhy/graph_learners/ges.py Replaces wildcard graph_operations import with explicit imports; adds explicit numpy import.
dowhy/graph_learners/cdt.py Replaces wildcard graph_operations import with explicit imports; adds explicit networkx and numpy imports.
dowhy/graph_learners/lingam.py Replaces wildcard graph_operations import with explicit imports; adds explicit numpy import.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant