open-feature / python-sdk

Python SDK for OpenFeature
https://openfeature.dev
Apache License 2.0
48 stars 16 forks source link

feat: make return value not optional in provider API functions #270

Closed federicobond closed 7 months ago

federicobond commented 7 months ago

This PR

Modifies the get_provider and get_provider_metadata return types to guarantee that they don't return a None value.

The default provider is initialized as a NoOpProvider at module loading time, so this simplifies the usage of the provider functions for clients.

codecov[bot] commented 7 months ago

Codecov Report

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

Comparison is base (1282bab) 94.02% compared to head (8329e89) 94.41%.

:exclamation: Current head 8329e89 differs from pull request most recent head c76bc8a. Consider uploading reports for the commit c76bc8a to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #270 +/- ## ========================================== + Coverage 94.02% 94.41% +0.39% ========================================== Files 17 17 Lines 452 448 -4 ========================================== - Hits 425 423 -2 + Misses 27 25 -2 ``` | [Flag](https://app.codecov.io/gh/open-feature/python-sdk/pull/270/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-feature) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/open-feature/python-sdk/pull/270/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-feature) | `94.41% <100.00%> (+0.39%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-feature#carryforward-flags-in-the-pull-request-comment) to find out more.

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