Skip to content

Fix type annotations for set_global_params and set_default_params#261

Merged
Borda merged 1 commit intopython-cachier:masterfrom
ROCKTAKEY:fix-params-type-annotation
Jun 2, 2025
Merged

Fix type annotations for set_global_params and set_default_params#261
Borda merged 1 commit intopython-cachier:masterfrom
ROCKTAKEY:fix-params-type-annotation

Conversation

@ROCKTAKEY
Copy link
Copy Markdown
Contributor

Hello, thanks for maintenance.

I fixed the wrong type annotations on set_global_params and set_default_params.

As we can see Arbitrary argument lists and default argument values, **kwargs: T types kwargs to dict[str, T], not T.

Thus on the code bellow:

def set_default_params(**params: Mapping) -> None:

type of params is dict[str, Mapping], but it should be probably dict[str, Any].

@ROCKTAKEY ROCKTAKEY requested a review from shaypal5 as a code owner March 16, 2025 15:46
@ROCKTAKEY ROCKTAKEY force-pushed the fix-params-type-annotation branch from c32290f to 4c62cee Compare March 16, 2025 15:52
@Borda
Copy link
Copy Markdown
Contributor

Borda commented May 28, 2025

I fixed the wrong type annotations on set_global_params and set_default_params

nice catch, thank you

@shaypal5 shaypal5 force-pushed the fix-params-type-annotation branch from 4c62cee to 4cd334c Compare May 31, 2025 15:56
@shaypal5 shaypal5 added the bug label May 31, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented May 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.34%. Comparing base (2a4d1c9) to head (4cd334c).
Report is 54 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #261      +/-   ##
==========================================
- Coverage   97.84%   95.34%   -2.51%     
==========================================
  Files           8       10       +2     
  Lines         511      580      +69     
  Branches       88       67      -21     
==========================================
+ Hits          500      553      +53     
- Misses         10       21      +11     
- Partials        1        6       +5     
Flag Coverage Δ
db 62.58% <100.00%> (?)
local 88.10% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/cachier/config.py 90.62% <100.00%> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2e141c...4cd334c. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Borda Borda merged commit ae4e8ce into python-cachier:master Jun 2, 2025
39 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants