From 52e104dc7375a87e5da72ee524b8019b089bfa7a Mon Sep 17 00:00:00 2001 From: Kevin Sheppard Date: Mon, 22 Aug 2022 16:31:53 +0100 Subject: [PATCH] CLN: Remove non-public classes --- pandas-stubs/io/stata.pyi | 51 --------------------------------------- tests/test_io.py | 6 ++--- 2 files changed, 2 insertions(+), 55 deletions(-) diff --git a/pandas-stubs/io/stata.pyi b/pandas-stubs/io/stata.pyi index 5bb90b47..12b8dad7 100644 --- a/pandas-stubs/io/stata.pyi +++ b/pandas-stubs/io/stata.pyi @@ -3,7 +3,6 @@ import datetime from io import BytesIO from types import TracebackType from typing import ( - Hashable, Literal, Sequence, overload, @@ -76,18 +75,6 @@ class ValueLabelTypeMismatch(Warning): ... class InvalidColumnName(Warning): ... class StataParser: - DTYPE_MAP: dict[int, np.dtype] = ... - DTYPE_MAP_XML: dict[int, np.dtype] = ... - TYPE_MAP: list[tuple[int | str, ...]] = ... - TYPE_MAP_XML: dict[int, str] = ... - VALID_RANGE: dict[ - str, - tuple[int, int] | tuple[np.float32, np.float32] | tuple[np.float64, np.float64], - ] = ... - OLD_TYPE_MAPPING: dict[int, int] = ... - MISSING_VALUES: dict[str, int] = ... - NUMPY_TYPE_MAP: dict[str, str] = ... - RESERVED_WORDS: tuple[str, ...] = ... def __init__(self) -> None: ... class StataReader(StataParser, abc.Iterator): @@ -134,7 +121,6 @@ class StataReader(StataParser, abc.Iterator): def value_labels(self) -> dict[str, dict[float, str]]: ... class StataWriter(StataParser): - type_converters: dict[str, type[np.dtype]] = ... def __init__( self, fname: FilePath | WriteBuffer[bytes], @@ -151,40 +137,3 @@ class StataWriter(StataParser): value_labels: dict[HashableT, dict[float, str]] | None = ..., ) -> None: ... def write_file(self) -> None: ... - -class StataWriter117(StataWriter): - def __init__( - self, - fname: FilePath | WriteBuffer[bytes], - data: DataFrame, - convert_dates: dict[HashableT, StataDateFormat] | None = ..., - write_index: bool = ..., - byteorder: str | None = ..., - time_stamp: datetime.datetime | None = ..., - data_label: str | None = ..., - variable_labels: dict[HashableT, str] | None = ..., - convert_strl: Sequence[Hashable] | None = ..., - compression: CompressionOptions = ..., - storage_options: StorageOptions = ..., - *, - value_labels: dict[HashableT, dict[float, str]] | None = ..., - ) -> None: ... - -class StataWriterUTF8(StataWriter117): - def __init__( - self, - fname: FilePath | WriteBuffer[bytes], - data: DataFrame, - convert_dates: dict[HashableT, StataDateFormat] | None = ..., - write_index: bool = ..., - byteorder: str | None = ..., - time_stamp: datetime.datetime | None = ..., - data_label: str | None = ..., - variable_labels: dict[HashableT, str] | None = ..., - convert_strl: Sequence[Hashable] | None = ..., - version: Literal[118, 119] | None = ..., - compression: CompressionOptions = ..., - storage_options: StorageOptions = ..., - *, - value_labels: dict[HashableT, dict[float, str]] | None = ..., - ) -> None: ... diff --git a/tests/test_io.py b/tests/test_io.py index 445f1ed2..e63acffd 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -2,6 +2,7 @@ from pandas import ( DataFrame, read_clipboard, + read_stata, ) from pandas._testing import ensure_clean import pytest @@ -11,10 +12,7 @@ from pandas.io.clipboard import PyperclipException from pandas.io.parsers import TextFileReader -from pandas.io.stata import ( - StataReader, - read_stata, -) +from pandas.io.stata import StataReader DF = DataFrame({"a": [1, 2, 3], "b": [0.0, 0.0, 0.0]})