mirror of
https://github.com/langgenius/dify.git
synced 2026-04-19 03:00:42 -04:00
refactor: replace bare dict with typed annotations in core plugin module (#35096)
This commit is contained in:
@@ -26,7 +26,7 @@ class PluginDatasourceManager(BasePluginClient):
|
||||
Fetch datasource providers for the given tenant.
|
||||
"""
|
||||
|
||||
def transformer(json_response: dict[str, Any]) -> dict:
|
||||
def transformer(json_response: dict[str, Any]) -> dict[str, Any]:
|
||||
if json_response.get("data"):
|
||||
for provider in json_response.get("data", []):
|
||||
declaration = provider.get("declaration", {}) or {}
|
||||
@@ -68,7 +68,7 @@ class PluginDatasourceManager(BasePluginClient):
|
||||
Fetch datasource providers for the given tenant.
|
||||
"""
|
||||
|
||||
def transformer(json_response: dict[str, Any]) -> dict:
|
||||
def transformer(json_response: dict[str, Any]) -> dict[str, Any]:
|
||||
if json_response.get("data"):
|
||||
for provider in json_response.get("data", []):
|
||||
declaration = provider.get("declaration", {}) or {}
|
||||
@@ -110,7 +110,7 @@ class PluginDatasourceManager(BasePluginClient):
|
||||
|
||||
tool_provider_id = DatasourceProviderID(provider_id)
|
||||
|
||||
def transformer(json_response: dict[str, Any]) -> dict:
|
||||
def transformer(json_response: dict[str, Any]) -> dict[str, Any]:
|
||||
data = json_response.get("data")
|
||||
if data:
|
||||
for datasource in data.get("declaration", {}).get("datasources", []):
|
||||
|
||||
Reference in New Issue
Block a user