Skip to content

Commit 8527b25

Browse files
authored
feat(error): #624 new warnings and errors (#1402)
1 parent 91dd427 commit 8527b25

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

pandas-stubs/errors/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ class PossiblePrecisionLoss(Warning): ...
4646
class ValueLabelTypeMismatch(Warning): ...
4747
class InvalidColumnName(Warning): ...
4848
class CategoricalConversionWarning(Warning): ...
49+
class InvalidVersion(ValueError): ...
50+
class NoBufferPresent(Exception): ...

tests/test_errors.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,13 @@ def test_invalid_column_name() -> None:
193193
def test_categorical_conversion_warning() -> None:
194194
with pytest.warns(errors.CategoricalConversionWarning):
195195
warnings.warn("", errors.CategoricalConversionWarning)
196+
197+
198+
def test_invalid_version() -> None:
199+
with pytest.raises(errors.InvalidVersion):
200+
raise errors.InvalidVersion()
201+
202+
203+
def test_no_buffer_present() -> None:
204+
with pytest.raises(errors.NoBufferPresent):
205+
raise errors.NoBufferPresent()

0 commit comments

Comments
 (0)