kr8s-org / kr8s

A batteries-included Python client library for Kubernetes that feels familiar for folks who already know how to use kubectl
https://kr8s.org
BSD 3-Clause "New" or "Revised" License
839 stars 45 forks source link

Remove typing shim in favour of typing.cast #420

Closed jacobtomlinson closed 4 months ago

jacobtomlinson commented 4 months ago

In #419 I added a shim for jsonpath.JSONPatch.apply because mypy didn't like that it returned an object.

I wasn't confident using a shim was the right approach so I opened https://stackoverflow.com/questions/78682971/override-return-type-hint-of-function-from-python-dependency/78682992#78682992.

The result of that SO question was that I needed to use typing.cast to force the type to be a dict.

This PR reverts the shim and uses typing.cast instead.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.32%. Comparing base (87063fc) to head (b4ba61d). Report is 65 commits behind head on main.

:exclamation: Current head b4ba61d differs from pull request most recent head 12beaec

Please upload reports for the commit 12beaec to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #420 +/- ## ========================================== + Coverage 94.61% 95.32% +0.70% ========================================== Files 29 30 +1 Lines 3141 3655 +514 ========================================== + Hits 2972 3484 +512 - Misses 169 171 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.