Merge branch 'fix_tests' into session_id
This commit is contained in:
commit
d01d8c2945
4 changed files with 6 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
from typing import Dict, List, Optional, Type
|
from typing import Dict, List, Optional, Type
|
||||||
|
|
||||||
from langchain import SQLDatabase, utilities
|
from langchain import utilities
|
||||||
|
|
||||||
from langflow.custom.customs import get_custom_nodes
|
from langflow.custom.customs import get_custom_nodes
|
||||||
from langflow.interface.base import LangChainTypeCreator
|
from langflow.interface.base import LangChainTypeCreator
|
||||||
|
|
@ -32,7 +32,7 @@ class UtilityCreator(LangChainTypeCreator):
|
||||||
utility_name: import_class(f"langchain.utilities.{utility_name}")
|
utility_name: import_class(f"langchain.utilities.{utility_name}")
|
||||||
for utility_name in utilities.__all__
|
for utility_name in utilities.__all__
|
||||||
}
|
}
|
||||||
self.type_dict["SQLDatabase"] = SQLDatabase
|
self.type_dict["SQLDatabase"] = utilities.SQLDatabase
|
||||||
# Filter according to settings.utilities
|
# Filter according to settings.utilities
|
||||||
self.type_dict = {
|
self.type_dict = {
|
||||||
name: utility
|
name: utility
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from typing import Dict, List, Optional
|
from typing import Dict, List, Optional
|
||||||
|
|
||||||
from langchain import requests, sql_database
|
from langchain.utilities import requests, sql_database
|
||||||
|
|
||||||
from langflow.interface.base import LangChainTypeCreator
|
from langflow.interface.base import LangChainTypeCreator
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,7 @@ class DatabaseService(Service):
|
||||||
|
|
||||||
# Now check if the table "flow" exists, if not, something went wrong
|
# Now check if the table "flow" exists, if not, something went wrong
|
||||||
# and we need to create the tables again.
|
# and we need to create the tables again.
|
||||||
|
inspector = inspect(self.engine)
|
||||||
table_names = inspector.get_table_names()
|
table_names = inspector.get_table_names()
|
||||||
for table in current_tables:
|
for table in current_tables:
|
||||||
if table not in table_names:
|
if table not in table_names:
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,10 @@ from langflow.services.utils import (
|
||||||
|
|
||||||
@patch("langflow.services.getters.get_settings_service")
|
@patch("langflow.services.getters.get_settings_service")
|
||||||
@patch("langflow.services.utils.create_super_user")
|
@patch("langflow.services.utils.create_super_user")
|
||||||
|
@patch("langflow.services.utils.verify_password")
|
||||||
@patch("langflow.services.getters.get_session")
|
@patch("langflow.services.getters.get_session")
|
||||||
def test_setup_superuser(
|
def test_setup_superuser(
|
||||||
mock_get_session, mock_create_super_user, mock_get_settings_service
|
mock_get_session, mock_create_super_user, mock_get_settings_service, mock_verify
|
||||||
):
|
):
|
||||||
# Test when AUTO_LOGIN is True
|
# Test when AUTO_LOGIN is True
|
||||||
calls = []
|
calls = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue