Skip to content

refactor: replace bare dict with dict[str, Any] in services and hosti…#35211

Merged
asukaminato0721 merged 2 commits intolanggenius:mainfrom
wdeveloper16:refactor/typed-dict-services-and-config
Apr 14, 2026
Merged

refactor: replace bare dict with dict[str, Any] in services and hosti…#35211
asukaminato0721 merged 2 commits intolanggenius:mainfrom
wdeveloper16:refactor/typed-dict-services-and-config

Conversation

@wdeveloper16
Copy link
Copy Markdown
Contributor

What this PR does

Part of #22651 — replaces bare dict annotations with dict[str, Any] in the RAG pipeline service, workflow service, and hosting configuration.

services/rag_pipeline/rag_pipeline.py (15 changes):

  • Return types: get_pipeline_templates, get_pipeline_template_detail, get_recommended_plugins
  • Local variables: built_in_result, customized_result
  • Parameters: graph, filters, user_inputs (×3), data, args (×3)

services/workflow_service.py (8 changes):

  • Parameters: graph, features, node_data (×2), args, features (validate), node_data (validate), data

core/hosting_configuration.py (1 change + import):

  • HostingProvider.credentials: dict | Nonedict[str, Any] | None; adds from typing import Any

Why

Bare dict is equivalent to dict[Any, Any], losing key-type information. All these dicts use string keys, so dict[str, Any] is the correct annotation and passes basedpyright strict checks.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. refactor labels Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

No changes detected.

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

No changes detected.

@asukaminato0721 asukaminato0721 added this pull request to the merge queue Apr 14, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 14, 2026
Merged via the queue into langgenius:main with commit 9c90c1c Apr 14, 2026
28 checks passed
HanqingZ pushed a commit to HanqingZ/dify that referenced this pull request Apr 23, 2026
langgenius#35211)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
asukaminato0721 pushed a commit to asukaminato0721/dify that referenced this pull request Apr 24, 2026
langgenius#35211)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants