Skip to content

refactor(api): tighten types in trivial lint and config fixes#34773

Merged
asukaminato0721 merged 2 commits intolanggenius:mainfrom
tmimmanuel:refactor/pyright-core-rag-pr2
Apr 8, 2026
Merged

refactor(api): tighten types in trivial lint and config fixes#34773
asukaminato0721 merged 2 commits intolanggenius:mainfrom
tmimmanuel:refactor/pyright-core-rag-pr2

Conversation

@tmimmanuel
Copy link
Copy Markdown
Contributor

Summary

  • Remove unused grpc import and fix Points argument type in qdrant vector adapter
  • Replace deprecated type comment with annotation in relyt vector adapter
  • Suppress chromadb private import warnings (Settings, DEFAULT_TENANT, DEFAULT_DATABASE) and fix results redeclaration
  • Suppress unstructured private/unused import warnings (side-effect imports)
  • Rename _create_collection_if_not_existscreate_collection_if_not_exists in analyticdb adapters (called externally)
  • Add Iterator[Any] return type to _get_cursor context manager in analyticdb SQL adapter
  • Add pgvecto_rs.sqlalchemy to allowedUntypedLibraries in pyrightconfig

Test plan

  • make type-check-core passes with 0 errors
  • All 105 affected unit tests pass (analyticdb, qdrant, chroma, relyt, unstructured)
  • No runtime behavior changes — type annotations and renames only

Part of #26412

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

github-actions Bot commented Apr 8, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-08 21:32:17.735052780 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-08 21:32:08.758993040 +0000
@@ -62,8 +62,6 @@
    --> core/rag/datasource/keyword/jieba/jieba.py:157:29
 ERROR Argument `object` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `list.__init__` [bad-argument-type]
   --> core/rag/datasource/keyword/jieba/jieba_keyword_table_handler.py:88:35
-ERROR Class member `AnalyticdbVector.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
-  --> core/rag/datasource/vdb/analyticdb/analyticdb_vector.py:43:9
 ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models._create_namespace_request.CreateNamespaceRequest.__init__` [bad-argument-type]
    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:120:40
 ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models._describe_collection_request.DescribeCollectionRequest.__init__` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-08 21:33:58.874034827 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-08 21:33:49.096996705 +0000
@@ -62,8 +62,6 @@
    --> core/rag/datasource/keyword/jieba/jieba.py:157:29
 ERROR Argument `object` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `list.__init__` [bad-argument-type]
   --> core/rag/datasource/keyword/jieba/jieba_keyword_table_handler.py:88:35
-ERROR Class member `AnalyticdbVector.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
-  --> core/rag/datasource/vdb/analyticdb/analyticdb_vector.py:43:9
 ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models._create_namespace_request.CreateNamespaceRequest.__init__` [bad-argument-type]
    --> core/rag/datasource/vdb/analyticdb/analyticdb_vector_openapi.py:120:40
 ERROR Argument `str | None` is not assignable to parameter `namespace_password` with type `str` in function `alibabacloud_gpdb20160503.models._describe_collection_request.DescribeCollectionRequest.__init__` [bad-argument-type]

@asukaminato0721 asukaminato0721 added this pull request to the merge queue Apr 8, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 8, 2026
Merged via the queue into langgenius:main with commit 1a4eb47 Apr 8, 2026
27 checks passed
@tmimmanuel tmimmanuel deleted the refactor/pyright-core-rag-pr2 branch April 9, 2026 02:30
HanqingZ pushed a commit to HanqingZ/dify that referenced this pull request Apr 23, 2026
…nius#34773)

Co-authored-by: tmimmanuel <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>
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