open-feature / python-sdk

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

fix: Hook methods should have default non-abstract implementations #216

Closed federicobond closed 11 months ago

federicobond commented 11 months ago

This PR

Fixes Hook methods incorrectly marked as abstract. The Hook class provides default implementations of all hook lifecycle methods. Hook subclasses only need to override the methods they are interested in.

codecov[bot] commented 11 months ago

Codecov Report

Merging #216 (7c264ab) into main (84af1ae) will decrease coverage by 0.08%. The diff coverage is 83.33%.

@@            Coverage Diff             @@
##             main     #216      +/-   ##
==========================================
- Coverage   93.34%   93.27%   -0.08%     
==========================================
  Files          16       16              
  Lines         451      446       -5     
==========================================
- Hits          421      416       -5     
  Misses         30       30              
Flag Coverage Δ
unittests 93.27% <83.33%> (-0.08%) :arrow_down:

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

Files Coverage Δ
openfeature/evaluation_context.py 91.66% <100.00%> (+0.75%) :arrow_up:
openfeature/hook/__init__.py 83.33% <50.00%> (-2.78%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

federicobond commented 11 months ago

@beeme1mr the return None change is just to comply explicitly with the declared return type of the method. It does not introduce any behavior changes and is functionally identical to the previous code.