Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

example for rm extra cast (#24646)

Asuka Minato4adf85d7d4b8
diff --git a/api/core/rag/datasource/vdb/tidb_on_qdrant/tidb_on_qdrant_vector.py b/api/core/rag/datasource/vdb/tidb_on_qdrant/tidb_on_qdrant_vector.py
index e848b39c4de..a76b5d579cc 100644
--- a/api/core/rag/datasource/vdb/tidb_on_qdrant/tidb_on_qdrant_vector.py
+++ b/api/core/rag/datasource/vdb/tidb_on_qdrant/tidb_on_qdrant_vector.py
@@ -3,7 +3,7 @@ import os
import uuid
from collections.abc import Generator, Iterable, Sequence
from itertools import islice
-from typing import TYPE_CHECKING, Any, Optional, Union, cast
+from typing import TYPE_CHECKING, Any, Optional, Union
import qdrant_client
import requests
@@ -398,7 +398,6 @@ class TidbOnQdrantVector(BaseVector):
def _reload_if_needed(self):
if isinstance(self._client, QdrantLocal):
- self._client = cast(QdrantLocal, self._client)
self._client._load()
@classmethod
diff --git a/api/services/webapp_auth_service.py b/api/services/webapp_auth_service.py
index 085a5039f15..bb46bf3090a 100644
--- a/api/services/webapp_auth_service.py
+++ b/api/services/webapp_auth_service.py
@@ -1,7 +1,7 @@
import enum
import secrets
from datetime import UTC, datetime, timedelta
-from typing import Any, Optional, cast
+from typing import Any, Optional
from werkzeug.exceptions import NotFound, Unauthorized
@@ -42,7 +42,7 @@ class WebAppAuthService:
if account.password is None or not compare_password(password, account.password, account.password_salt):
raise AccountPasswordError("Invalid email or password.")
- return cast(Account, account)
+ return account
@classmethod
def login(cls, account: Account) -> str: