Skip to content

Commit 370e07d

Browse files
committed
Remove unused private code in sas module
1 parent d6c2586 commit 370e07d

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

pandas/io/sas/sas7bdat.py

-22
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from collections import abc
2020
from datetime import (
2121
datetime,
22-
timedelta,
2322
)
2423
import sys
2524
from typing import TYPE_CHECKING
@@ -44,7 +43,6 @@
4443
from pandas import (
4544
DataFrame,
4645
Timestamp,
47-
isna,
4846
)
4947

5048
from pandas.io.common import get_handle
@@ -55,7 +53,6 @@
5553
from pandas._typing import (
5654
CompressionOptions,
5755
FilePath,
58-
NaTType,
5956
ReadBuffer,
6057
)
6158

@@ -64,20 +61,6 @@
6461
_sas_origin = Timestamp("1960-01-01")
6562

6663

67-
def _parse_datetime(sas_datetime: float, unit: str) -> datetime | NaTType:
68-
if isna(sas_datetime):
69-
return pd.NaT
70-
71-
if unit == "s":
72-
return datetime(1960, 1, 1) + timedelta(seconds=sas_datetime)
73-
74-
elif unit == "d":
75-
return datetime(1960, 1, 1) + timedelta(days=sas_datetime)
76-
77-
else:
78-
raise ValueError("unit must be 'd' or 's'")
79-
80-
8164
def _convert_datetimes(sas_datetimes: pd.Series, unit: str) -> pd.Series:
8265
"""
8366
Convert to Timestamp if possible, otherwise to datetime.datetime.
@@ -370,11 +353,6 @@ def _read_bytes(self, offset: int, length: int):
370353
raise ValueError("The cached page is too small.")
371354
return self._cached_page[offset : offset + length]
372355

373-
def _read_and_convert_header_text(self, offset: int, length: int) -> str | bytes:
374-
return self._convert_header_text(
375-
self._read_bytes(offset, length).rstrip(b"\x00 ")
376-
)
377-
378356
def _parse_metadata(self) -> None:
379357
done = False
380358
while not done:

0 commit comments

Comments
 (0)