chore: linting
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
44e7b64aae
commit
294013955e
2 changed files with 9 additions and 4 deletions
|
|
@ -162,7 +162,9 @@ ResponseDict: TypeAlias = _dict[str, Any] # type: ignore[no-any-explicit]
|
|||
FlagsDict: TypeAlias = _dict[str, Any] # type: ignore[no-any-explicit]
|
||||
FormDict: TypeAlias = _dict[str, str]
|
||||
|
||||
db: LocalProxy[Union["PyMariaDBDatabase", "MariaDBDatabase", "PostgresDatabase", "SQLiteDatabase"]] = local("db")
|
||||
db: LocalProxy[Union["PyMariaDBDatabase", "MariaDBDatabase", "PostgresDatabase", "SQLiteDatabase"]] = local(
|
||||
"db"
|
||||
)
|
||||
qb: LocalProxy[Union["MariaDB", "Postgres", "SQLite"]] = local("qb")
|
||||
conf: LocalProxy[ConfType] = local("conf")
|
||||
form_dict: LocalProxy[FormDict] = local("form_dict")
|
||||
|
|
|
|||
|
|
@ -38,14 +38,15 @@ from frappe.utils import CallbackManager, cint, get_datetime, get_table_name, ge
|
|||
from frappe.utils import cast as cast_fieldtype
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from sqlite3 import Connection as SQLiteConnection
|
||||
from sqlite3 import Cursor as SQLiteCursor
|
||||
|
||||
from MySQLdb.connections import Connection as MySQLdbConnection
|
||||
from MySQLdb.cursors import Cursor as MySQLdbCursor
|
||||
from psycopg2 import connection as PostgresConnection
|
||||
from psycopg2 import cursor as PostgresCursor
|
||||
from pymysql.connections import Connection as MariadbConnection
|
||||
from pymysql.cursors import Cursor as MariadbCursor
|
||||
from sqlite3 import Connection as SQLiteConnection
|
||||
from sqlite3 import Cursor as SQLiteCursor
|
||||
|
||||
IFNULL_PATTERN = re.compile(r"ifnull\(", flags=re.IGNORECASE)
|
||||
INDEX_PATTERN = re.compile(r"\s*\([^)]+\)\s*")
|
||||
|
|
@ -130,7 +131,9 @@ class Database:
|
|||
|
||||
def connect(self):
|
||||
"""Connects to a database as set in `site_config.json`."""
|
||||
self._conn: MySQLdbConnection | MariadbConnection | PostgresConnection | SQLiteConnection = self.get_connection()
|
||||
self._conn: MySQLdbConnection | MariadbConnection | PostgresConnection | SQLiteConnection = (
|
||||
self.get_connection()
|
||||
)
|
||||
self._cursor: MySQLdbCursor | MariadbCursor | PostgresCursor | SQLiteCursor = self._conn.cursor()
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue