Skip to content

Commit f0cfb87

Browse files
committed
SAS7BDAT parser: Drop unused instance variables
1 parent 5763023 commit f0cfb87

File tree

1 file changed

+1
-41
lines changed

1 file changed

+1
-41
lines changed

pandas/io/sas/sas7bdat.py

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class SAS7BDATReader(ReaderBase, abc.Iterator):
148148
Return SAS7BDATReader object for iterations, returns chunks
149149
with given number of lines.
150150
encoding : str, 'infer', defaults to None
151-
String encoding acc. to python standard encodings,
151+
String encoding acc. to Python standard encodings,
152152
encoding='infer' tries to detect the encoding from the file header,
153153
encoding=None will leave the data in binary format.
154154
convert_text : bool, defaults to True
@@ -273,23 +273,6 @@ def _get_properties(self) -> None:
273273
else:
274274
self.inferred_encoding = f"unknown (code={buf})"
275275

276-
# Get platform information
277-
buf = self._read_bytes(const.platform_offset, const.platform_length)
278-
if buf == b"1":
279-
self.platform = "unix"
280-
elif buf == b"2":
281-
self.platform = "windows"
282-
else:
283-
self.platform = "unknown"
284-
285-
self.name = self._read_and_convert_header_text(
286-
const.dataset_offset, const.dataset_length
287-
)
288-
289-
self.file_type = self._read_and_convert_header_text(
290-
const.file_type_offset, const.file_type_length
291-
)
292-
293276
# Timestamp is epoch 01/01/1960
294277
epoch = datetime(1960, 1, 1)
295278
x = self._read_float(
@@ -316,29 +299,6 @@ def _get_properties(self) -> None:
316299
self._page_length = self._read_int(
317300
const.page_size_offset + align1, const.page_size_length
318301
)
319-
self._page_count = self._read_int(
320-
const.page_count_offset + align1, const.page_count_length
321-
)
322-
323-
self.sas_release_offset = self._read_and_convert_header_text(
324-
const.sas_release_offset + total_align, const.sas_release_length
325-
)
326-
327-
self.server_type = self._read_and_convert_header_text(
328-
const.sas_server_type_offset + total_align, const.sas_server_type_length
329-
)
330-
331-
self.os_version = self._read_and_convert_header_text(
332-
const.os_version_number_offset + total_align, const.os_version_number_length
333-
)
334-
335-
self.os_name = self._read_and_convert_header_text(
336-
const.os_name_offset + total_align, const.os_name_length
337-
)
338-
if not self.os_name:
339-
self.os_name = self._read_and_convert_header_text(
340-
const.os_maker_offset + total_align, const.os_maker_length
341-
)
342302

343303
def __next__(self) -> DataFrame:
344304
da = self.read(nrows=self.chunksize or 1)

0 commit comments

Comments
 (0)