Skip to content

CLN: Remove unused private attributes in stata module #57818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,11 +1121,8 @@ def __init__(

# State variables for the file
self._close_file: Callable[[], None] | None = None
self._missing_values = False
self._can_read_value_labels = False
self._column_selector_set = False
self._value_labels_read = False
self._data_read = False
self._dtype: np.dtype | None = None
self._lines_read = 0

Expand Down Expand Up @@ -1650,8 +1647,6 @@ def read(
# StopIteration. If reading the whole thing return an empty
# data frame.
if (self._nobs == 0) and nrows == 0:
self._can_read_value_labels = True
self._data_read = True
data = DataFrame(columns=self._varlist)
# Apply dtypes correctly
for i, col in enumerate(data.columns):
Expand All @@ -1664,7 +1659,6 @@ def read(
return data

if (self._format_version >= 117) and (not self._value_labels_read):
self._can_read_value_labels = True
self._read_strls()

# Read data
Expand All @@ -1687,9 +1681,7 @@ def read(
)

self._lines_read += read_lines
if self._lines_read == self._nobs:
self._can_read_value_labels = True
self._data_read = True

# if necessary, swap the byte order to native here
if self._byteorder != self._native_byteorder:
raw_data = raw_data.byteswap().view(raw_data.dtype.newbyteorder())
Expand Down