|
24 | 24 | from requests import Session, Response |
25 | 25 |
|
26 | 26 | from . import api_globals |
27 | | -from .api_exceptions import (AuthError, ConnectionClosedException, CursorClosedException, |
28 | | - DatabaseError, ProgrammingError) |
| 27 | +from .api_exceptions import ( |
| 28 | + AuthError, |
| 29 | + ConnectionClosedException, |
| 30 | + CursorClosedException, |
| 31 | + DatabaseError, |
| 32 | + DrillWarning, |
| 33 | + Error, |
| 34 | + IntegrityError, |
| 35 | + InterfaceError, |
| 36 | + InternalError, |
| 37 | + NotSupportedError, |
| 38 | + OperationalError, |
| 39 | + ProgrammingError, |
| 40 | +) |
| 41 | + |
| 42 | +# DB-API 2.0 requires Warning to be exported at module level |
| 43 | +# We renamed it to DrillWarning to avoid shadowing built-in, but alias it here |
| 44 | +Warning = DrillWarning # noqa: A001 # pylint: disable=redefined-builtin |
| 45 | + |
| 46 | +# Explicit exports for DB-API 2.0 compliance |
| 47 | +__all__ = [ |
| 48 | + # Module globals |
| 49 | + 'apilevel', 'threadsafety', 'paramstyle', |
| 50 | + # Classes |
| 51 | + 'Connection', 'Cursor', |
| 52 | + # Functions |
| 53 | + 'connect', |
| 54 | + # Type objects |
| 55 | + 'STRING', 'BINARY', 'NUMBER', 'DATETIME', 'ROWID', |
| 56 | + 'BOOL', 'SMALLINT', 'INTEGER', 'LONG', 'FLOAT', 'NUMERIC', |
| 57 | + 'DATE', 'TIME', 'TIMESTAMP', 'INTERVAL', |
| 58 | + # Type constructors |
| 59 | + 'Date', 'Time', 'Timestamp', 'DateFromTicks', 'TimeFromTicks', 'TimestampFromTicks', 'Binary', |
| 60 | + # Exceptions (DB-API 2.0 required) |
| 61 | + 'Warning', 'Error', 'InterfaceError', 'DatabaseError', 'OperationalError', |
| 62 | + 'IntegrityError', 'InternalError', 'ProgrammingError', 'NotSupportedError', |
| 63 | + # Additional exceptions |
| 64 | + 'AuthError', 'CursorClosedException', 'ConnectionClosedException', |
| 65 | +] |
29 | 66 |
|
30 | 67 | apilevel = '2.0' |
31 | 68 | threadsafety = 3 |
|
0 commit comments