Skip to content

[Repo Assist] fix(identifier): export CausalIdentifier Protocol from dowhy.causal_identifier - #1808

Merged
emrekiciman merged 1 commit into
mainfrom
repo-assist/fix-causal-identifier-missing-export-20260909-10a9f7af92eec888
Sep 16, 2026
Merged

emrekiciman merged 1 commit into
mainfrom
repo-assist/fix-causal-identifier-missing-export-20260909-10a9f7af92eec888

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Problem

CausalIdentifier — the Protocol that both AutoIdentifier and IDIdentifier conform to — is defined in dowhy/causal_identifier/identify_effect.py but was never added to dowhy/causal_identifier/__init__.py. This means the import:

from dowhy.causal_identifier import CausalIdentifier

raises ImportError: cannot import name 'CausalIdentifier' from 'dowhy.causal_identifier', as reported in issue #831.

Root Cause

identify_effect.py imports and identify_effect function were added to __init__.py, but the CausalIdentifier Protocol class defined in the same file was never included.

Fix

Single line added to dowhy/causal_identifier/__init__.py:

# Before
from dowhy.causal_identifier.identify_effect import identify_effect

# After
from dowhy.causal_identifier.identify_effect import CausalIdentifier, identify_effect

And "CausalIdentifier" added to __all__.

Tests

Added two tests to tests/causal_identifiers/test_auto_identifier.py:

Test What it verifies
test_causal_identifier_protocol_importable_from_top_level from dowhy.causal_identifier import CausalIdentifier no longer raises ImportError
test_auto_identifier_and_id_identifier_conform_to_causal_identifier_protocol Both AutoIdentifier and IDIdentifier satisfy the Protocol's structural requirements

Test Status

  • ✅ Syntax valid (ast.parse)
  • ✅ No logic changes — purely adds a missing export
  • Full CI will validate both new tests and all existing identifier tests

Partially addresses #831.

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

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

…dentifier

CausalIdentifier is defined in dowhy/causal_identifier/identify_effect.py
as a Protocol that both AutoIdentifier and IDIdentifier conform to.
It was not exported from the package's __init__.py, causing
'ImportError: cannot import name CausalIdentifier from dowhy.causal_identifier'
(reported in #831).

Add CausalIdentifier to the __init__.py imports and __all__ list.
Add regression tests verifying both the import works and that
AutoIdentifier/IDIdentifier conform to the Protocol.

Partially addresses #831.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions github-actions Bot added automation bug Something isn't working repo-assist labels Sep 9, 2026
@emrekiciman
emrekiciman marked this pull request as ready for review September 13, 2026 07:48
@emrekiciman
emrekiciman merged commit c04d8b1 into main Sep 16, 2026
44 of 79 checks passed
@emrekiciman
emrekiciman deleted the repo-assist/fix-causal-identifier-missing-export-20260909-10a9f7af92eec888 branch September 16, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation bug Something isn't working repo-assist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant