🐛 fix(manager.py): fix import statement to include Dict in typing module
✨ feat(manager.py): refactor check_table method in DatabaseManager class to use list comprehension for improved readability and performance
This commit is contained in:
parent
2e09d53ced
commit
ae2e993680
2 changed files with 5 additions and 7 deletions
|
|
@ -107,12 +107,10 @@ class DatabaseManager(Service):
|
|||
# We will check that all models are in the database
|
||||
# and that the database is up to date with all columns
|
||||
sql_models = [models.Flow, models.User, models.ApiKey]
|
||||
results = []
|
||||
for sql_model in sql_models:
|
||||
results.append(
|
||||
TableResults(sql_model.__tablename__, self.check_table(sql_model))
|
||||
)
|
||||
return results
|
||||
return [
|
||||
TableResults(sql_model.__tablename__, self.check_table(sql_model))
|
||||
for sql_model in sql_models
|
||||
]
|
||||
|
||||
def check_table(self, model):
|
||||
results = []
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from langflow.services.schema import ServiceType
|
||||
from typing import TYPE_CHECKING, List, Optional
|
||||
from typing import TYPE_CHECKING, Dict, List, Optional
|
||||
from loguru import logger
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue