🐛 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
|
# We will check that all models are in the database
|
||||||
# and that the database is up to date with all columns
|
# and that the database is up to date with all columns
|
||||||
sql_models = [models.Flow, models.User, models.ApiKey]
|
sql_models = [models.Flow, models.User, models.ApiKey]
|
||||||
results = []
|
return [
|
||||||
for sql_model in sql_models:
|
|
||||||
results.append(
|
|
||||||
TableResults(sql_model.__tablename__, self.check_table(sql_model))
|
TableResults(sql_model.__tablename__, self.check_table(sql_model))
|
||||||
)
|
for sql_model in sql_models
|
||||||
return results
|
]
|
||||||
|
|
||||||
def check_table(self, model):
|
def check_table(self, model):
|
||||||
results = []
|
results = []
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
from langflow.services.schema import ServiceType
|
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
|
from loguru import logger
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue