[Repo Assist] fix(identifier): export CausalIdentifier Protocol from dowhy.causal_identifier - #1808
Merged
emrekiciman merged 1 commit intoSep 16, 2026
Conversation
…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>
emrekiciman
approved these changes
Sep 16, 2026
emrekiciman
deleted the
repo-assist/fix-causal-identifier-missing-export-20260909-10a9f7af92eec888
branch
September 16, 2026 06:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Problem
CausalIdentifier— the Protocol that bothAutoIdentifierandIDIdentifierconform to — is defined indowhy/causal_identifier/identify_effect.pybut was never added todowhy/causal_identifier/__init__.py. This means the import:raises
ImportError: cannot import name 'CausalIdentifier' from 'dowhy.causal_identifier', as reported in issue #831.Root Cause
identify_effect.pyimports andidentify_effectfunction were added to__init__.py, but theCausalIdentifierProtocol class defined in the same file was never included.Fix
Single line added to
dowhy/causal_identifier/__init__.py:And
"CausalIdentifier"added to__all__.Tests
Added two tests to
tests/causal_identifiers/test_auto_identifier.py:test_causal_identifier_protocol_importable_from_top_levelfrom dowhy.causal_identifier import CausalIdentifierno longer raisesImportErrortest_auto_identifier_and_id_identifier_conform_to_causal_identifier_protocolAutoIdentifierandIDIdentifiersatisfy the Protocol's structural requirementsTest Status
ast.parse)Partially addresses #831.