Skip to content

Commit a46da1c

Browse files
Merge branch 'release-1.6.0' into merge/release-1.6.0-to-main-v2
2 parents 722ce3b + 38c918f commit a46da1c

File tree

5 files changed

+22
-25
lines changed

5 files changed

+22
-25
lines changed

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ dependencies = [
122122
"cleanlab-tlm>=1.1.2",
123123
'gassist>=0.0.1; sys_platform == "win32"',
124124
"twelvelabs>=0.4.7",
125-
"docling_core>=2.36.1",
125+
"docling>=2.36.1",
126126
"filelock>=3.18.0",
127127
"jigsawstack==0.2.7",
128128
"structlog>=25.4.0",
@@ -181,7 +181,6 @@ dev = [
181181
"pytest-timeout>=2.3.1",
182182
"pyyaml>=6.0.2",
183183
"pyleak>=0.1.14",
184-
"docling>=2.36.1"
185184
]
186185

187186
[tool.uv.sources]

src/backend/base/langflow/initial_setup/setup.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
from langflow.services.database.models.flow.model import Flow, FlowCreate
4040
from langflow.services.database.models.folder.constants import DEFAULT_FOLDER_NAME
4141
from langflow.services.database.models.folder.model import Folder, FolderCreate, FolderRead
42-
from langflow.services.database.models.user.crud import get_user_by_username
4342
from langflow.services.deps import get_settings_service, get_storage_service, get_variable_service, session_scope
4443

4544
# In the folder ./starter_projects we have a few JSON files that represent
@@ -727,20 +726,21 @@ async def load_flows_from_directory() -> None:
727726
"""On langflow startup, this loads all flows from the directory specified in the settings.
728727
729728
All flows are uploaded into the default folder for the superuser.
730-
Note that this feature currently only works if AUTO_LOGIN is enabled in the settings.
731729
"""
732730
settings_service = get_settings_service()
733731
flows_path = settings_service.settings.load_flows_path
734732
if not flows_path:
735733
return
736-
if not settings_service.auth_settings.AUTO_LOGIN:
737-
await logger.awarning("AUTO_LOGIN is disabled, not loading flows from directory")
738-
return
739734

740735
async with session_scope() as session:
741-
user = await get_user_by_username(session, settings_service.auth_settings.SUPERUSER)
736+
# Find superuser by role instead of username to avoid issues with credential reset
737+
from langflow.services.database.models.user.model import User
738+
739+
stmt = select(User).where(User.is_superuser == True) # noqa: E712
740+
result = await session.exec(stmt)
741+
user = result.first()
742742
if user is None:
743-
msg = "Superuser not found in the database"
743+
msg = "No superuser found in the database"
744744
raise NoResultFound(msg)
745745

746746
# Ensure that the default folder exists for this user
@@ -793,13 +793,16 @@ async def load_bundles_from_urls() -> tuple[list[TemporaryDirectory], list[str]]
793793
bundle_urls = settings_service.settings.bundle_urls
794794
if not bundle_urls:
795795
return [], []
796-
if not settings_service.auth_settings.AUTO_LOGIN:
797-
await logger.awarning("AUTO_LOGIN is disabled, not loading flows from URLs")
798796

799797
async with session_scope() as session:
800-
user = await get_user_by_username(session, settings_service.auth_settings.SUPERUSER)
798+
# Find superuser by role instead of username to avoid issues with credential reset
799+
from langflow.services.database.models.user.model import User
800+
801+
stmt = select(User).where(User.is_superuser == True) # noqa: E712
802+
result = await session.exec(stmt)
803+
user = result.first()
801804
if user is None:
802-
msg = "Superuser not found in the database"
805+
msg = "No superuser found in the database"
803806
raise NoResultFound(msg)
804807
user_id = user.id
805808

@@ -816,11 +819,7 @@ async def load_bundles_from_urls() -> tuple[list[TemporaryDirectory], list[str]]
816819
for filename in zfile.namelist():
817820
path = Path(filename)
818821
for dir_name in dir_names:
819-
if (
820-
settings_service.auth_settings.AUTO_LOGIN
821-
and path.is_relative_to(f"{dir_name}flows/")
822-
and path.suffix == ".json"
823-
):
822+
if path.is_relative_to(f"{dir_name}flows/") and path.suffix == ".json":
824823
file_content = zfile.read(filename)
825824
await upsert_flow_from_file(file_content, path.stem, session, user_id)
826825
elif path.is_relative_to(f"{dir_name}components/"):

src/backend/tests/unit/components/tools/test_python_repl_tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def test_component_initialization(self, component_class, default_kwargs):
4545

4646
# Test python_code configuration
4747
python_code = template["python_code"]
48-
assert python_code["type"] == "code"
48+
# assert python_code["type"] == "code" # TODO: Restore when CodeInput is included in component
49+
assert python_code["type"] == "str" # TODO: Remove when CodeInput is included in component
4950
assert python_code["value"] == "print('Hello, World!')"
5051
assert python_code["required"] is True
5152

src/lfx/src/lfx/components/processing/python_repl_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from langchain_experimental.utilities import PythonREPL
44

55
from lfx.custom.custom_component.component import Component
6-
from lfx.io import CodeInput, Output, StrInput
6+
from lfx.io import MultilineInput, Output, StrInput
77
from lfx.schema.data import Data
88

99

@@ -21,7 +21,7 @@ class PythonREPLComponent(Component):
2121
value="math,pandas",
2222
required=True,
2323
),
24-
CodeInput(
24+
MultilineInput(
2525
name="python_code",
2626
display_name="Python Code",
2727
info="The Python code to execute. Only modules specified in Global Imports can be used.",

uv.lock

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)