Exception Handling¶
This section covers all PyAthena exception classes and error handling.
Exception Hierarchy¶
- exception pyathena.error.DataError[source]¶
Bases:
DatabaseErrorException for errors due to invalid data.
Raised when there are problems with the data being processed, such as data type conversion errors, values out of range, or malformed data structures.
- exception pyathena.error.DatabaseError[source]¶
Bases:
ErrorBase exception for database-related errors.
This is the base class for all exceptions that are related to the database itself, rather than the interface. All other database error types inherit from this class.
- exception pyathena.error.Error[source]¶
Bases:
ExceptionBase exception class for all PyAthena errors.
This is the root exception class in the PyAthena exception hierarchy. All other PyAthena exceptions inherit from this class, following the Python Database API Specification v2.0 (PEP 249).
- exception pyathena.error.InterfaceError[source]¶
Bases:
ErrorException for errors related to the database interface.
Raised when there’s an error in the database interface itself, such as connection problems or interface misuse.
- exception pyathena.error.InternalError[source]¶
Bases:
DatabaseErrorException for internal database errors.
Raised when there’s an internal error in the database system that is not due to user actions or programming errors.
- exception pyathena.error.NotSupportedError[source]¶
Bases:
DatabaseErrorException for unsupported database operations.
Raised when attempting to use functionality that is not supported by Athena, such as transactions (commit/rollback) or certain SQL features that are not available in the Athena query engine.
- exception pyathena.error.OperationalError[source]¶
Bases:
DatabaseErrorException for errors during database operation processing.
Raised when Athena query execution fails due to operational issues such as query timeouts, resource limits, permission errors, or invalid query syntax that wasn’t caught at the programming level.
- exception pyathena.error.ProgrammingError[source]¶
Bases:
DatabaseErrorException for programming errors in database operations.
Raised when there are errors in the way the database interface is being used, such as calling methods in the wrong order, using invalid parameters, or attempting operations on closed connections.
Base Exceptions¶
Interface Errors¶
Data Errors¶
- class pyathena.error.DataError[source]¶
Exception for errors due to invalid data.
Raised when there are problems with the data being processed, such as data type conversion errors, values out of range, or malformed data structures.
Operational Errors¶
- class pyathena.error.OperationalError[source]¶
Exception for errors during database operation processing.
Raised when Athena query execution fails due to operational issues such as query timeouts, resource limits, permission errors, or invalid query syntax that wasn’t caught at the programming level.