From a917f253c9f8c14e69ba4a0f9097b346f0f33c7e Mon Sep 17 00:00:00 2001 From: Waket Zheng Date: Sun, 2 Jun 2024 17:56:54 +0800 Subject: [PATCH] Add type hints for inspectdb/sqlite --- aerich/inspectdb/sqlite.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aerich/inspectdb/sqlite.py b/aerich/inspectdb/sqlite.py index 7f35e1f..8cafa95 100644 --- a/aerich/inspectdb/sqlite.py +++ b/aerich/inspectdb/sqlite.py @@ -1,11 +1,11 @@ -from typing import List +from typing import Callable, Dict, List from aerich.inspectdb import Column, Inspect class InspectSQLite(Inspect): @property - def field_map(self) -> dict: + def field_map(self) -> Dict[str, Callable[..., str]]: return { "INTEGER": self.int_field, "INT": self.bool_field, @@ -45,7 +45,7 @@ class InspectSQLite(Inspect): ) return columns - async def _get_columns_index(self, table: str): + async def _get_columns_index(self, table: str) -> Dict[str, str]: sql = f"PRAGMA index_list ({table})" indexes = await self.conn.execute_query_dict(sql) ret = {}