Skip to content
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

LookupHandler is now a Generic abstract base class #2524

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

ITProKyle
Copy link
Collaborator

Summary

runway.lookups.handlers.base.LookupHandler is now a Generic ABC (abstract base class).

Why This Is Needed

  • classes that inherit from abc.ABC can require methods to be defined by subclasses at runtime beyond just raising NotImplimentedError
    • also verified by type checkers/linters
  • typing.Generic can be used to improve type checking

What Changed

Changed

  • runway.lookups.handlers.base.LookupHandler is now an ABC (abstract base class)
    • handle method is now decorated with abstractmethod to ensure it is defined by subclasses beyond just raising NotImplimentedError
  • runway.lookups.handlers.base.LookupHandler is now a Generic
  • updated all lookups to reflect the changes to LookupHandler
  • updated documentation to reflect the changes to LookupHandler

@ITProKyle ITProKyle added the changelog:minor Minor change resulting in a minor release label Aug 21, 2024
@ITProKyle ITProKyle self-assigned this Aug 21, 2024
@github-actions github-actions bot added feature Request or pull request for a new feature python Update to Python code labels Aug 21, 2024
Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.17%. Comparing base (9961015) to head (fd4a8c9).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2524   +/-   ##
=======================================
  Coverage   90.17%   90.17%           
=======================================
  Files         256      256           
  Lines       15650    15651    +1     
=======================================
+ Hits        14112    14114    +2     
+ Misses       1538     1537    -1     
Files Coverage Δ
runway/cfngin/lookups/handlers/ami.py 100.00% <100.00%> (ø)
runway/cfngin/lookups/handlers/awslambda.py 93.54% <100.00%> (+0.84%) ⬆️
runway/cfngin/lookups/handlers/default.py 100.00% <100.00%> (ø)
runway/cfngin/lookups/handlers/dynamodb.py 100.00% <100.00%> (ø)
runway/cfngin/lookups/handlers/envvar.py 100.00% <100.00%> (ø)
runway/cfngin/lookups/handlers/file.py 100.00% <100.00%> (ø)
runway/cfngin/lookups/handlers/hook_data.py 100.00% <100.00%> (ø)
runway/cfngin/lookups/handlers/kms.py 96.29% <100.00%> (ø)
runway/cfngin/lookups/handlers/output.py 96.42% <100.00%> (ø)
runway/cfngin/lookups/handlers/rxref.py 100.00% <100.00%> (ø)
... and 12 more

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 9961015...fd4a8c9. Read the comment docs.

@ITProKyle ITProKyle enabled auto-merge (squash) August 21, 2024 19:52
@ITProKyle ITProKyle merged commit ee36279 into master Aug 21, 2024
24 checks passed
@ITProKyle ITProKyle deleted the feat/lookup-type-improvements branch September 12, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:minor Minor change resulting in a minor release feature Request or pull request for a new feature python Update to Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants