Skip to content

refactor(api): type storage statistics with StorageStatisticsDict TypedDict#34609

Merged
asukaminato0721 merged 2 commits intolanggenius:mainfrom
YB0y:refactor/typed-dict-storage-statistics
Apr 7, 2026
Merged

refactor(api): type storage statistics with StorageStatisticsDict TypedDict#34609
asukaminato0721 merged 2 commits intolanggenius:mainfrom
YB0y:refactor/typed-dict-storage-statistics

Conversation

@YB0y
Copy link
Copy Markdown
Contributor

@YB0y YB0y commented Apr 6, 2026

Summary

  • Add StorageStatisticsDict TypedDict with 8 keys (total_files, active_files, archived_files, deleted_files, total_size, versions_count, oldest_file, newest_file)
  • Annotate return type of get_storage_statistics and use TypedDict constructor for both the normal and error fallback paths

Why this change

get_storage_statistics constructs a dict with 8 fixed keys but was typed as dict[str, Any]. The TypedDict makes the statistics shape explicit and provides correct per-field types (int vs str | None).

Changes

  • extensions/storage/clickzetta_volume/file_lifecycle.py: Define StorageStatisticsDict, update method return type and both return paths

Test plan

  • ruff check passes

Part of #32863 (extensions/storage/clickzetta_volume/file_lifecycle.py)

@YB0y YB0y requested a review from QuantumGhost as a code owner April 6, 2026 17:32
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. refactor labels Apr 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2026

Pyrefly Diff

No changes detected.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2026

Pyrefly Diff

No changes detected.

@asukaminato0721 asukaminato0721 added this pull request to the merge queue Apr 7, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 7, 2026
Merged via the queue into langgenius:main with commit 8d37116 Apr 7, 2026
27 checks passed
@YB0y YB0y deleted the refactor/typed-dict-storage-statistics branch April 8, 2026 13:35
HanqingZ pushed a commit to HanqingZ/dify that referenced this pull request Apr 23, 2026
…edDict (langgenius#34609)

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