Skip to content

Commit

Permalink
fix the type hint error for | in Python3.7 by using typing.Union
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongyoonlee committed Apr 13, 2024
1 parent 8528f35 commit 6fd5df2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion causalml/inference/tree/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""

from collections import defaultdict
from typing import Union

import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -399,7 +400,7 @@ def __init__(
self.treatment_groups = treatment_groups

def node_to_str(
self, tree: _tree.Tree, node_id: int, criterion: str | object
self, tree: _tree.Tree, node_id: int, criterion: Union[str, object]
) -> str:
"""
Generate the node content string
Expand Down

0 comments on commit 6fd5df2

Please sign in to comment.