Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-python/src/exceptions.rs
7884 views
1
//! Define the Polars exception hierarchy.
2
3
use pyo3::create_exception;
4
use pyo3::exceptions::{PyException, PyWarning};
5
6
// Errors
7
create_exception!(polars.exceptions, PolarsError, PyException);
8
create_exception!(polars.exceptions, ColumnNotFoundError, PolarsError);
9
create_exception!(polars.exceptions, ComputeError, PolarsError);
10
create_exception!(polars.exceptions, DuplicateError, PolarsError);
11
create_exception!(polars.exceptions, InvalidOperationError, PolarsError);
12
create_exception!(polars.exceptions, NoDataError, PolarsError);
13
create_exception!(polars.exceptions, OutOfBoundsError, PolarsError);
14
create_exception!(polars.exceptions, SQLInterfaceError, PolarsError);
15
create_exception!(polars.exceptions, SQLSyntaxError, PolarsError);
16
create_exception!(polars.exceptions, SchemaError, PolarsError);
17
create_exception!(polars.exceptions, SchemaFieldNotFoundError, PolarsError);
18
create_exception!(polars.exceptions, ShapeError, PolarsError);
19
create_exception!(polars.exceptions, StringCacheMismatchError, PolarsError);
20
create_exception!(polars.exceptions, StructFieldNotFoundError, PolarsError);
21
22
// Warnings
23
create_exception!(polars.exceptions, PolarsWarning, PyWarning);
24
create_exception!(polars.exceptions, PerformanceWarning, PolarsWarning);
25
create_exception!(
26
polars.exceptions,
27
CategoricalRemappingWarning,
28
PerformanceWarning
29
);
30
create_exception!(
31
polars.exceptions,
32
MapWithoutReturnDtypeWarning,
33
PolarsWarning
34
);
35
36