Skip to content

Commit f468280

Browse files
committed
TST: Fix issues due to changes in tests
1 parent 52fa043 commit f468280

File tree

10 files changed

+22
-68
lines changed

10 files changed

+22
-68
lines changed

pandas-stubs/core/base.pyi

-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ from pandas._typing import (
1717
npt,
1818
)
1919

20-
# TODO: These two moved to pandas.errors after switch to 1.5.x
21-
class DataError(Exception): ...
22-
class SpecificationError(Exception): ...
23-
2420
class PandasObject(DirNamesMixin):
2521
def __sizeof__(self) -> int: ...
2622

pandas-stubs/core/common.pyi

-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ from typing import (
55

66
from pandas._typing import T
77

8-
# TODO: Remove from here after 1.5.x is target, moved to pandas.errors
9-
class SettingWithCopyError(ValueError): ...
10-
class SettingWithCopyWarning(Warning): ...
11-
128
def flatten(line) -> None: ...
139
def consensus_name_attr(objs): ...
1410
def is_bool_indexer(key) -> bool: ...

pandas-stubs/core/computation/engines.pyi

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import abc
22

3-
# TODO: Remove from here after 1.5.x, moved to pandas.errors
4-
class NumExprClobberingError(NameError): ...
5-
63
class AbstractEngine(metaclass=abc.ABCMeta):
74
has_neg_frac: bool = ...
85
expr = ...

pandas-stubs/core/indexing.pyi

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ class _IndexSlice:
2424

2525
IndexSlice: _IndexSlice
2626

27-
# TODO: Remove from here after 1.5.x, moved to pandas.errors
28-
class IndexingError(Exception): ...
29-
3027
class IndexingMixin:
3128
@property
3229
def iloc(self) -> _iLocIndexer: ...

pandas-stubs/errors/__init__.pyi

+22-31
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1+
from pandas.core.computation.ops import UndefinedVariableError as UndefinedVariableError
2+
13
from pandas._config.config import OptionError as OptionError
24

35
from pandas._libs.tslibs import (
46
OutOfBoundsDatetime as OutOfBoundsDatetime,
57
OutOfBoundsTimedelta as OutOfBoundsTimedelta,
68
)
79

8-
from pandas.io.clipboard import PyperclipWindowsException as PyperclipWindowsException
9-
10-
# TODO: Uncomment import below after switch to 1.5.x.
11-
# from pandas.core.computation.ops import UndefinedVariableError as UndefinedVariableError
12-
1310
class IntCastingNaNError(ValueError): ...
1411
class NullFrequencyError(ValueError): ...
1512
class PerformanceWarning(Warning): ...
@@ -28,30 +25,24 @@ class AbstractMethodError(NotImplementedError):
2825
class NumbaUtilError(Exception): ...
2926
class DuplicateLabelError(ValueError): ...
3027
class InvalidIndexError(Exception): ...
28+
class DataError(Exception): ...
29+
class SpecificationError(Exception): ...
30+
class SettingWithCopyError(ValueError): ...
31+
class SettingWithCopyWarning(Warning): ...
32+
class NumExprClobberingError(NameError): ...
33+
class IndexingError(Exception): ...
34+
class PyperclipException(RuntimeError): ...
35+
36+
class PyperclipWindowsException(PyperclipException):
37+
def __init__(self, message) -> None: ...
3138

32-
# TODO: Uncomment and delete from pandas.core.base after switch to 1.5.x
33-
# class DataError(Exception): ...
34-
# class SpecificationError(Exception): ...
35-
# TODO: Uncomment and delete from pandas.core.common after switch to 1.5.x
36-
# class SettingWithCopyError(ValueError): ...
37-
# class SettingWithCopyWarning(Warning): ...
38-
# TODO: Uncomment and delete from pandas.core.computation.engines after switch to 1.5.x
39-
# class NumExprClobberingError(NameError): ...
40-
# TODO: Uncomment and delete from core.indexing after switch to 1.5.x
41-
# class IndexingError(Exception): ...
42-
# TODO: Uncomment and delete from io.clipboards.__init__ after switch to 1.5.x
43-
# class PyperclipException(RuntimeError): ...
44-
# TODO: Uncomment and delete from io.formats.css after switch to 1.5.x
45-
# class CSSWarning(UserWarning): ...
46-
# TODO: Uncomment and delete next 4 from io.pytables after switch to 1.5.x
47-
# class PossibleDataLossError(Exception): ...
48-
# class ClosedFileError(Exception): ...
49-
# class IncompatibilityWarning(Warning): ...
50-
# class AttributeConflictWarning(Warning): ...
51-
# TODO: Uncomment and delete from io.sql after switch to 1.5.x
52-
# class DatabaseError(OSError): ...
53-
# TODO: Uncomment and delete from io.stata after switch to 1.5.x
54-
# class PossiblePrecisionLoss(Warning): ...
55-
# class ValueLabelTypeMismatch(Warning): ...
56-
# class InvalidColumnName(Warning): ...
57-
# class CategoricalConversionWarning(Warning): ...
39+
class CSSWarning(UserWarning): ...
40+
class PossibleDataLossError(Exception): ...
41+
class ClosedFileError(Exception): ...
42+
class IncompatibilityWarning(Warning): ...
43+
class AttributeConflictWarning(Warning): ...
44+
class DatabaseError(OSError): ...
45+
class PossiblePrecisionLoss(Warning): ...
46+
class ValueLabelTypeMismatch(Warning): ...
47+
class InvalidColumnName(Warning): ...
48+
class CategoricalConversionWarning(Warning): ...
-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
# TODO: Remove PyperclipException after switch to 1.5.x, moved to pandas.errors
2-
class PyperclipException(RuntimeError): ...
3-
4-
class PyperclipWindowsException(PyperclipException):
5-
def __init__(self, message) -> None: ...

pandas-stubs/io/formats/css.pyi

-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
# TODO: Remove after 1.5.x, moved to pandas.errors
2-
class CSSWarning(UserWarning): ...

pandas-stubs/io/pytables.pyi

-7
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ from pandas._typing import (
2323

2424
Term = PyTablesExpr
2525

26-
# TODO: Remove these after switch to 1.5.x, moved to pandas.errors
27-
class PossibleDataLossError(Exception): ...
28-
class ClosedFileError(Exception): ...
29-
class IncompatibilityWarning(Warning): ...
30-
class AttributeConflictWarning(Warning): ...
31-
class DuplicateWarning(Warning): ...
32-
3326
@overload
3427
def read_hdf(
3528
path_or_buf: FilePath | HDFStore,

pandas-stubs/io/sql.pyi

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ from pandas._typing import (
1919
npt,
2020
)
2121

22-
# TODO: Remove after switch to 1.5.x, moved to pandas.errors
23-
class DatabaseError(IOError): ...
24-
2522
_SQLConnection = Union[
2623
str,
2724
sqlalchemy.engine.Connectable,

pandas-stubs/io/stata.pyi

-6
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ def read_stata(
7070
storage_options: StorageOptions = ...,
7171
) -> DataFrame: ...
7272

73-
# TODO: Remove after switch to 1.5.x, moved to pandas.errors
74-
class PossiblePrecisionLoss(Warning): ...
75-
class ValueLabelTypeMismatch(Warning): ...
76-
class InvalidColumnName(Warning): ...
77-
class CategoricalConversionWarning(Warning): ...
78-
7973
class StataParser:
8074
def __init__(self) -> None: ...
8175

0 commit comments

Comments
 (0)