Skip to content

Commit

Permalink
CLN: Restore Union[int, float]
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtage committed Jan 16, 2020
1 parent a2d33aa commit 4e64f01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ class StataMissingValue:
"float64": struct.unpack("<d", float64_base)[0],
}

def __init__(self, value: float):
def __init__(self, value: Union[int, float]):
self._value = value
# Conversion to int to avoid hash issues on 32 bit platforms #8968
value = int(value) if value < 2147483648 else float(value)
Expand All @@ -781,7 +781,7 @@ def string(self) -> str:
return self._str

@property
def value(self) -> float:
def value(self) -> Union[int, float]:
"""
The binary representation of the missing value.
Expand All @@ -806,7 +806,7 @@ def __eq__(self, other: Any) -> bool:
)

@classmethod
def get_base_missing_value(cls, dtype: np.dtype) -> float:
def get_base_missing_value(cls, dtype: np.dtype) -> Union[int, float]:
if dtype == np.int8:
value = cls.BASE_MISSING_VALUES["int8"]
elif dtype == np.int16:
Expand Down

0 comments on commit 4e64f01

Please sign in to comment.