Skip to content

Commit f2a5272

Browse files
authored
CLN: Remove unused private attributes in stata module (#57818)
Remove unused private code in stata module
1 parent 8130850 commit f2a5272

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

pandas/io/stata.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -1121,11 +1121,8 @@ def __init__(
11211121

11221122
# State variables for the file
11231123
self._close_file: Callable[[], None] | None = None
1124-
self._missing_values = False
1125-
self._can_read_value_labels = False
11261124
self._column_selector_set = False
11271125
self._value_labels_read = False
1128-
self._data_read = False
11291126
self._dtype: np.dtype | None = None
11301127
self._lines_read = 0
11311128

@@ -1650,8 +1647,6 @@ def read(
16501647
# StopIteration. If reading the whole thing return an empty
16511648
# data frame.
16521649
if (self._nobs == 0) and nrows == 0:
1653-
self._can_read_value_labels = True
1654-
self._data_read = True
16551650
data = DataFrame(columns=self._varlist)
16561651
# Apply dtypes correctly
16571652
for i, col in enumerate(data.columns):
@@ -1664,7 +1659,6 @@ def read(
16641659
return data
16651660

16661661
if (self._format_version >= 117) and (not self._value_labels_read):
1667-
self._can_read_value_labels = True
16681662
self._read_strls()
16691663

16701664
# Read data
@@ -1687,9 +1681,7 @@ def read(
16871681
)
16881682

16891683
self._lines_read += read_lines
1690-
if self._lines_read == self._nobs:
1691-
self._can_read_value_labels = True
1692-
self._data_read = True
1684+
16931685
# if necessary, swap the byte order to native here
16941686
if self._byteorder != self._native_byteorder:
16951687
raw_data = raw_data.byteswap().view(raw_data.dtype.newbyteorder())

0 commit comments

Comments
 (0)