Skip to content

Commit

Permalink
Change use of Protocol from typing instead of typing_extension
Browse files Browse the repository at this point in the history
The graph module uses Protocols, which is natively supported since Python 3.8 (the required minimum version for DoWhy). To support Protocols in earlier Python versions, an extension provided Protocol support. However, this extension can causes compatibility issues with newer versions of other packages.

DoWhy now uses the Protocol implementation that is available since Python 3.8.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
  • Loading branch information
bloebp committed Nov 3, 2023
1 parent 8c893fe commit ef91e18
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dowhy/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
"""

from abc import abstractmethod
from typing import Any, List
from typing import Any, List, Protocol

import networkx as nx
from networkx.algorithms.dag import has_cycle
from typing_extensions import Protocol


class HasNodes(Protocol):
Expand Down

0 comments on commit ef91e18

Please sign in to comment.