Skip to content

Commit

Permalink
docs(python): Include a doc entry for every exception type (#17001)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego authored Jun 16, 2024
1 parent 1b57f9d commit ce62b33
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 6 deletions.
30 changes: 29 additions & 1 deletion py-polars/docs/source/reference/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,49 @@ Exceptions
==========
.. currentmodule:: polars.exceptions

Errors
~~~~~~

.. autosummary::
:toctree: api/
:nosignatures:

PolarsError
ChronoFormatWarning
ColumnNotFoundError
ComputeError
DuplicateError
InvalidAssert
InvalidOperationError
ModuleUpgradeRequired
NoDataError
NoRowsReturnedError
PolarsError
OutOfBoundsError
ParameterCollisionError
PolarsPanicError
RowsError
SQLInterfaceError
SQLSyntaxError
SchemaError
SchemaFieldNotFoundError
ShapeError
StringCacheMismatchError
StructFieldNotFoundError
TooManyRowsReturnedError
UnsuitableSQLError

Warnings
~~~~~~~~

.. autosummary::
:toctree: api/
:nosignatures:

PolarsWarning
CategoricalRemappingWarning
ChronoFormatWarning
CustomUFuncWarning
MapWithoutReturnDtypeWarning
PerformanceWarning
PolarsInefficientMapWarning
UnstableWarning
32 changes: 28 additions & 4 deletions py-polars/polars/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,32 @@
ChronoFormatWarning,
ColumnNotFoundError,
ComputeError,
CustomUFuncWarning,
DuplicateError,
InvalidAssert,
InvalidOperationError,
MapWithoutReturnDtypeWarning,
ModuleUpgradeRequired,
NoDataError,
NoRowsReturnedError,
OutOfBoundsError,
ParameterCollisionError,
PerformanceWarning,
PolarsError,
PolarsInefficientMapWarning,
PolarsPanicError,
PolarsWarning,
RowsError,
SchemaError,
SchemaFieldNotFoundError,
ShapeError,
SQLInterfaceError,
SQLSyntaxError,
StringCacheMismatchError,
StructFieldNotFoundError,
TooManyRowsReturnedError,
UnstableWarning,
UnsuitableSQLError,
)
from polars.expr import Expr
from polars.functions import (
Expand Down Expand Up @@ -229,29 +240,42 @@
del _get_polars_version

__all__ = [
# modules
"api",
"exceptions",
"plugins",
# exceptions/errors
# exceptions - errors
"PolarsError",
"ChronoFormatWarning",
"ColumnNotFoundError",
"ComputeError",
"DuplicateError",
"InvalidAssert",
"InvalidOperationError",
"ModuleUpgradeRequired",
"NoDataError",
"NoRowsReturnedError",
"OutOfBoundsError",
"PolarsError",
"ParameterCollisionError",
"PolarsPanicError",
"RowsError",
"SQLInterfaceError",
"SQLSyntaxError",
"SchemaError",
"SchemaFieldNotFoundError",
"ShapeError",
"StringCacheMismatchError",
"StructFieldNotFoundError",
# warnings
"TooManyRowsReturnedError",
"UnsuitableSQLError",
# exceptions - warnings
"PolarsWarning",
"CategoricalRemappingWarning",
"ChronoFormatWarning",
"CustomUFuncWarning",
"MapWithoutReturnDtypeWarning",
"PolarsWarning",
"PerformanceWarning",
"PolarsInefficientMapWarning",
"UnstableWarning",
# core classes
"DataFrame",
Expand Down
5 changes: 4 additions & 1 deletion py-polars/polars/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,18 @@ class UnstableWarning(PolarsWarning): # type: ignore[misc]

__all__ = [
# Errors
"PolarsError",
"ChronoFormatWarning",
"ColumnNotFoundError",
"ComputeError",
"DuplicateError",
"InvalidAssert",
"InvalidOperationError",
"ModuleUpgradeRequired",
"NoDataError",
"NoRowsReturnedError",
"OutOfBoundsError",
"PolarsError",
"ParameterCollisionError",
"PolarsPanicError",
"RowsError",
"SQLInterfaceError",
Expand All @@ -179,6 +181,7 @@ class UnstableWarning(PolarsWarning): # type: ignore[misc]
"StringCacheMismatchError",
"StructFieldNotFoundError",
"TooManyRowsReturnedError",
"UnsuitableSQLError",
# Warnings
"PolarsWarning",
"CategoricalRemappingWarning",
Expand Down

0 comments on commit ce62b33

Please sign in to comment.