diff --git a/pandas-stubs/io/sas/sasreader.pyi b/pandas-stubs/io/sas/sasreader.pyi index d988b1b9..10a4ae87 100644 --- a/pandas-stubs/io/sas/sasreader.pyi +++ b/pandas-stubs/io/sas/sasreader.pyi @@ -34,7 +34,7 @@ def read_sas( *, format: Literal["sas7bdat"], index: Hashable | None = ..., - encoding: str | None = ..., + encoding: Literal["infer"] | None = ..., chunksize: int, iterator: bool = ..., compression: CompressionOptions = ..., @@ -45,7 +45,7 @@ def read_sas( *, format: Literal["xport"], index: Hashable | None = ..., - encoding: str | None = ..., + encoding: Literal["infer"] | None = ..., chunksize: int, iterator: bool = ..., compression: CompressionOptions = ..., @@ -56,7 +56,7 @@ def read_sas( *, format: None = ..., index: Hashable | None = ..., - encoding: str | None = ..., + encoding: Literal["infer"] | None = ..., chunksize: int, iterator: bool = ..., compression: CompressionOptions = ..., @@ -67,7 +67,7 @@ def read_sas( *, format: Literal["sas7bdat"], index: Hashable | None = ..., - encoding: str | None = ..., + encoding: Literal["infer"] | None = ..., chunksize: int | None = ..., iterator: Literal[True], compression: CompressionOptions = ..., @@ -78,7 +78,7 @@ def read_sas( *, format: Literal["xport"], index: Hashable | None = ..., - encoding: str | None = ..., + encoding: Literal["infer"] | None = ..., chunksize: int | None = ..., iterator: Literal[True], compression: CompressionOptions = ..., @@ -89,7 +89,7 @@ def read_sas( *, format: None = ..., index: Hashable | None = ..., - encoding: str | None = ..., + encoding: Literal["infer"] | None = ..., chunksize: int | None = ..., iterator: Literal[True], compression: CompressionOptions = ..., @@ -100,7 +100,7 @@ def read_sas( *, format: Literal["xport", "sas7bdat"] | None = ..., index: Hashable | None = ..., - encoding: str | None = ..., + encoding: Literal["infer"] | None = ..., chunksize: None = ..., iterator: Literal[False] = ..., compression: CompressionOptions = ..., diff --git a/tests/test_io.py b/tests/test_io.py index e259b82e..42831552 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -1204,3 +1204,8 @@ def test_sqlalchemy_text() -> None: assert_type(read_sql(sql_select, con=conn), DataFrame), DataFrame, ) + + +def test_read_sas_encoding() -> None: + path = pathlib.Path(CWD, "data", "airline.sas7bdat") + check(assert_type(read_sas(path), DataFrame), DataFrame)