mirror of
https://github.com/langgenius/dify.git
synced 2026-09-08 02:43:49 +08:00
chore(deps-dev): bump the dev group in /api with 48 updates (#41896)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
cf34e3ee1a
commit
60e983c493
@ -41,6 +41,7 @@
|
||||
# core/policy/publish_policy.py
|
||||
from controllers.console.app import request_context
|
||||
|
||||
|
||||
def can_publish() -> bool:
|
||||
return request_context.current_user.is_admin
|
||||
```
|
||||
@ -50,6 +51,7 @@
|
||||
def can_publish(role: str) -> bool:
|
||||
return role == "admin"
|
||||
|
||||
|
||||
# service layer adapts web/user context to domain input
|
||||
allowed = can_publish(role=current_user.role)
|
||||
```
|
||||
@ -66,6 +68,7 @@
|
||||
# api/libs/conversation_filter.py
|
||||
from services.conversation_service import ConversationService
|
||||
|
||||
|
||||
def should_archive_conversation(conversation, tenant_id: str) -> bool:
|
||||
# Domain policy and service dependency are leaking into libs.
|
||||
service = ConversationService()
|
||||
@ -79,9 +82,11 @@
|
||||
def older_than_days(idle_days: int, threshold_days: int) -> bool:
|
||||
return idle_days > threshold_days
|
||||
|
||||
|
||||
# services/conversation_service.py (business logic stays in service/core)
|
||||
from libs.datetime_utils import older_than_days
|
||||
|
||||
|
||||
def should_archive_conversation(conversation, tenant_id: str) -> bool:
|
||||
threshold_days = 90 if has_paid_plan(tenant_id) else 30
|
||||
return older_than_days(conversation.idle_days, threshold_days)
|
||||
|
||||
@ -50,6 +50,7 @@
|
||||
```python
|
||||
from sqlalchemy.orm import Mapped
|
||||
|
||||
|
||||
class Dataset(TypeBase):
|
||||
__tablename__ = "datasets"
|
||||
id: Mapped[str] = mapped_column(StringUUID, primary_key=True)
|
||||
@ -59,6 +60,7 @@
|
||||
```python
|
||||
from sqlalchemy.orm import Mapped
|
||||
|
||||
|
||||
class Dataset(TypeBase):
|
||||
__tablename__ = "datasets"
|
||||
id: Mapped[str] = mapped_column(StringUUID, primary_key=True)
|
||||
@ -101,6 +103,7 @@
|
||||
from sqlalchemy.dialects.postgresql import JSONB
|
||||
from sqlalchemy.orm import Mapped
|
||||
|
||||
|
||||
class ToolConfig(TypeBase):
|
||||
__tablename__ = "tool_configs"
|
||||
config: Mapped[dict] = mapped_column(JSONB, nullable=False)
|
||||
@ -111,6 +114,7 @@
|
||||
|
||||
from models.types import AdjustedJSON
|
||||
|
||||
|
||||
class ToolConfig(TypeBase):
|
||||
__tablename__ = "tool_configs"
|
||||
config: Mapped[dict] = mapped_column(AdjustedJSON(), nullable=False)
|
||||
@ -146,7 +150,5 @@
|
||||
default_expr = sa.text("'database'::character varying") if _is_pg(conn) else sa.text("'database'")
|
||||
|
||||
with op.batch_alter_table("dataset_keyword_tables") as batch_op:
|
||||
batch_op.add_column(
|
||||
sa.Column("data_source_type", sa.String(255), server_default=default_expr, nullable=False)
|
||||
)
|
||||
batch_op.add_column(sa.Column("data_source_type", sa.String(255), server_default=default_expr, nullable=False))
|
||||
```
|
||||
|
||||
@ -18,9 +18,7 @@
|
||||
# Existing repository is ignored and service uses ad-hoc table queries.
|
||||
class AppService:
|
||||
def archive_app(self, app_id: str, tenant_id: str) -> None:
|
||||
app = self.session.execute(
|
||||
select(App).where(App.id == app_id, App.tenant_id == tenant_id)
|
||||
).scalar_one()
|
||||
app = self.session.execute(select(App).where(App.id == app_id, App.tenant_id == tenant_id)).scalar_one()
|
||||
app.archived = True
|
||||
self.session.commit()
|
||||
```
|
||||
@ -33,6 +31,7 @@
|
||||
app.archived = True
|
||||
self.app_repo.save(app)
|
||||
|
||||
|
||||
# If the query is missing, extend the existing abstraction.
|
||||
active_apps = self.app_repo.list_active_for_tenant(tenant_id=tenant_id)
|
||||
```
|
||||
@ -50,9 +49,10 @@
|
||||
class ConversationRepository(Protocol):
|
||||
def list_recent_for_app(self, app_id: str, tenant_id: str, limit: int) -> list[Conversation]: ...
|
||||
|
||||
|
||||
class SqlAlchemyConversationRepository:
|
||||
def list_recent_for_app(self, app_id: str, tenant_id: str, limit: int) -> list[Conversation]:
|
||||
...
|
||||
def list_recent_for_app(self, app_id: str, tenant_id: str, limit: int) -> list[Conversation]: ...
|
||||
|
||||
|
||||
class ConversationService:
|
||||
def __init__(self, conversation_repo: ConversationRepository):
|
||||
|
||||
@ -126,9 +126,7 @@
|
||||
|
||||
# 3) Pessimistic lock with SELECT ... FOR UPDATE (high contention)
|
||||
run = session.execute(
|
||||
select(WorkflowRun)
|
||||
.where(WorkflowRun.id == run_id, WorkflowRun.tenant_id == tenant_id)
|
||||
.with_for_update()
|
||||
select(WorkflowRun).where(WorkflowRun.id == run_id, WorkflowRun.tenant_id == tenant_id).with_for_update()
|
||||
).scalar_one()
|
||||
run.status = "cancelled"
|
||||
session.commit()
|
||||
|
||||
@ -32,8 +32,7 @@ List these key names in your `OpsTraceProviderConfigMap` entry so encrypt/decryp
|
||||
Subclass `BaseTraceInstance` and implement:
|
||||
|
||||
```python
|
||||
def trace(self, trace_info: BaseTraceInfo) -> None:
|
||||
...
|
||||
def trace(self, trace_info: BaseTraceInfo) -> None: ...
|
||||
```
|
||||
|
||||
Dispatch on the concrete type with `isinstance` (see `trace_langfuse` or `trace_langsmith` for full patterns). Payload types are defined in `core/ops/entities/trace_entity.py`, including:
|
||||
|
||||
@ -123,63 +123,63 @@ override-dependencies = [
|
||||
# Required for development and running tests
|
||||
############################################################
|
||||
dev = [
|
||||
"coverage>=7.13.4",
|
||||
"dotenv-linter>=0.7.0",
|
||||
"faker>=40.15.0",
|
||||
"coverage>=7.16.0",
|
||||
"dotenv-linter>=0.9.0",
|
||||
"faker>=40.38.0",
|
||||
"lxml-stubs>=0.5.1",
|
||||
"ruff>=0.15.12",
|
||||
"pytest>=9.0.3",
|
||||
"pytest-benchmark>=5.2.3",
|
||||
"ruff>=0.16.6",
|
||||
"pytest>=9.1.1",
|
||||
"pytest-benchmark>=5.3.0",
|
||||
"pytest-cov>=7.1.0",
|
||||
"pytest-env>=1.6.0",
|
||||
"pytest-env>=1.7.0",
|
||||
"pytest-mock>=3.15.1",
|
||||
"testcontainers>=4.14.2",
|
||||
"types-aiofiles>=25.1.0",
|
||||
"types-aiofiles>=25.1.0.20260518",
|
||||
"types-beautifulsoup4>=4.12.0",
|
||||
"types-cachetools>=7.0.0.20260503",
|
||||
"types-colorama>=0.4.15",
|
||||
"types-defusedxml>=0.7.0",
|
||||
"types-deprecated>=1.3.1",
|
||||
"types-docutils>=0.22.3",
|
||||
"types-flask-cors>=6.0.0",
|
||||
"types-flask-migrate>=4.1.0",
|
||||
"types-gevent>=26.4.0",
|
||||
"types-greenlet>=3.5.0.20260428",
|
||||
"types-html5lib>=1.1.11",
|
||||
"types-markdown>=3.10.2",
|
||||
"types-oauthlib>=3.3.0",
|
||||
"types-objgraph>=3.6.0",
|
||||
"types-olefile>=0.47.0",
|
||||
"types-openpyxl>=3.1.5",
|
||||
"types-pexpect>=4.9.0",
|
||||
"types-protobuf>=7.34.1.20260503",
|
||||
"types-psutil>=7.2.2",
|
||||
"types-psycopg2>=2.9.21.20260422",
|
||||
"types-pygments>=2.20.0",
|
||||
"types-pymysql>=1.1.0",
|
||||
"types-python-dateutil>=2.9.0",
|
||||
"types-pywin32>=311.0.0",
|
||||
"types-pyyaml>=6.0.12",
|
||||
"types-regex>=2026.4.4",
|
||||
"types-shapely>=2.1.0",
|
||||
"types-simplejson>=3.20.0.20260408",
|
||||
"types-six>=1.17.0.20260408",
|
||||
"types-tensorflow>=2.18.0.20260408",
|
||||
"types-tqdm>=4.67.3.20260408",
|
||||
"types-cachetools>=7.0.0.20260713",
|
||||
"types-colorama>=0.4.15.20260508",
|
||||
"types-defusedxml>=0.7.0.20260504",
|
||||
"types-deprecated>=1.3.1.20260728",
|
||||
"types-docutils>=0.23.0.20260827",
|
||||
"types-flask-cors>=6.0.3.20260712",
|
||||
"types-flask-migrate>=4.1.0.20260508",
|
||||
"types-gevent>=26.8.0.20260811",
|
||||
"types-greenlet>=3.5.0.20260518",
|
||||
"types-html5lib>=1.1.11.20260518",
|
||||
"types-markdown>=3.10.2.20260712",
|
||||
"types-oauthlib>=3.3.0.20260724",
|
||||
"types-objgraph>=3.6.0.20260508",
|
||||
"types-olefile>=0.47.0.20260508",
|
||||
"types-openpyxl>=3.1.5.20260827",
|
||||
"types-pexpect>=4.9.0.20260518",
|
||||
"types-protobuf>=7.35.1.20260827",
|
||||
"types-psutil>=7.2.2.20260827",
|
||||
"types-psycopg2>=2.9.21.20260724",
|
||||
"types-pygments>=2.21.0.20260819",
|
||||
"types-pymysql>=1.2.0.20260807",
|
||||
"types-python-dateutil>=2.9.0.20260807",
|
||||
"types-pywin32>=312.0.0.20260827",
|
||||
"types-pyyaml>=6.0.12.20260815",
|
||||
"types-regex>=2026.9.3.20260903",
|
||||
"types-shapely>=2.1.0.20260728",
|
||||
"types-simplejson>=4.1.0.20260724",
|
||||
"types-six>=1.17.0.20260724",
|
||||
"types-tensorflow>=2.18.0.20260827",
|
||||
"types-tqdm>=4.70.0.20260827",
|
||||
"types-ujson>=5.10.0",
|
||||
"boto3-stubs>=1.43.10",
|
||||
"types-jmespath>=1.1.0.20260408",
|
||||
"hypothesis>=6.152.4",
|
||||
"boto3-stubs>=1.43.88",
|
||||
"types-jmespath>=1.1.0.20260724",
|
||||
"hypothesis>=6.167.1",
|
||||
"types_pyOpenSSL>=24.1.0",
|
||||
"types_cffi>=2.0.0.20260429",
|
||||
"types_setuptools>=82.0.0.20260408",
|
||||
"pandas-stubs>=3.0.0",
|
||||
"scipy-stubs>=1.17.1.4",
|
||||
"types-python-http-client>=3.3.7.20260408",
|
||||
"import-linter>=2.3",
|
||||
"types_cffi>=2.1.0.20260827",
|
||||
"types_setuptools>=84.0.0.20260812",
|
||||
"pandas-stubs>=3.0.5.260730",
|
||||
"scipy-stubs>=1.18.1.0",
|
||||
"types-python-http-client>=3.3.7.20260518",
|
||||
"import-linter>=2.14",
|
||||
"types-redis>=4.6.0.20241004",
|
||||
"celery-types>=0.23.0",
|
||||
"mypy>=1.20.2",
|
||||
"mypy>=2.3.1",
|
||||
# "locust>=2.40.4", # Temporarily removed due to compatibility issues. Uncomment when resolved.
|
||||
"pytest-timeout>=2.4.0",
|
||||
"pytest-xdist>=3.8.0",
|
||||
|
||||
610
api/uv.lock
generated
610
api/uv.lock
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user