Skip to content

Commit 79a1460

Browse files
committed
CLN: Restore Union[int, float]
1 parent 3b0c6b6 commit 79a1460

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/io/stata.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ class StataMissingValue:
762762
"float64": struct.unpack("<d", float64_base)[0],
763763
}
764764

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

783783
@property
784-
def value(self) -> float:
784+
def value(self) -> Union[int, float]:
785785
"""
786786
The binary representation of the missing value.
787787
@@ -806,7 +806,7 @@ def __eq__(self, other: Any) -> bool:
806806
)
807807

808808
@classmethod
809-
def get_base_missing_value(cls, dtype: np.dtype) -> float:
809+
def get_base_missing_value(cls, dtype: np.dtype) -> Union[int, float]:
810810
if dtype == np.int8:
811811
value = cls.BASE_MISSING_VALUES["int8"]
812812
elif dtype == np.int16:

0 commit comments

Comments
 (0)