Skip to content

refactor(api): type DatasourceProviderApiEntity.to_dict with TypedDict#34879

Merged
asukaminato0721 merged 1 commit intolanggenius:mainfrom
volcano303:refactor/typed-dict-datasource-provider-api-entity
Apr 10, 2026
Merged

refactor(api): type DatasourceProviderApiEntity.to_dict with TypedDict#34879
asukaminato0721 merged 1 commit intolanggenius:mainfrom
volcano303:refactor/typed-dict-datasource-provider-api-entity

Conversation

@volcano303
Copy link
Copy Markdown
Contributor

Part of #32863 (api/core/datasource/entities/)

Summary

  • Define DatasourceProviderApiEntityDict TypedDict for the return value of DatasourceProviderApiEntity.to_dict()
  • Use explicit variable annotation pattern for basedpyright compatibility

Why this change

DatasourceProviderApiEntity.to_dict() returned a bare dict with 14 fixed keys. Adding a TypedDict makes the return shape explicit, improving editor autocomplete and catching key-name typos at type-check time.

Changes

  • api/core/datasource/entities/api_entities.py: Define DatasourceProviderApiEntityDict, annotate to_dict() return type

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. refactor labels Apr 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

No changes detected.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 10, 2026
@asukaminato0721 asukaminato0721 added this pull request to the merge queue Apr 10, 2026
Merged via the queue into langgenius:main with commit 40e23ce Apr 10, 2026
27 checks passed
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:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants