Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 18, 2023

Conversation

federicobond
Copy link
Member

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.

@federicobond federicobond requested a review from beeme1mr October 18, 2023 14:14
Signed-off-by: Federico Bond <federicobond@gmail.com>
Signed-off-by: Federico Bond <federicobond@gmail.com>
@federicobond federicobond force-pushed the hook-no-abstractmethod branch from a2819cf to 322a9dc Compare October 18, 2023 14:15
@codecov
Copy link

codecov bot commented Oct 18, 2023

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%) ⬇️

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%) ⬆️
openfeature/hook/__init__.py 83.33% <50.00%> (-2.78%) ⬇️

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

Copy link
Member

@beeme1mr beeme1mr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did the return value

@federicobond
Copy link
Member Author

@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.

Signed-off-by: Federico Bond <federicobond@gmail.com>
Signed-off-by: Federico Bond <federicobond@gmail.com>
@federicobond federicobond force-pushed the hook-no-abstractmethod branch from 8621844 to 91f9858 Compare October 18, 2023 15:01
@federicobond federicobond merged commit c661ab2 into open-feature:main Oct 18, 2023
This was referenced Nov 1, 2023
@federicobond federicobond deleted the hook-no-abstractmethod branch November 3, 2023 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants