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

Switch to using direct repository injection #38

Merged

Conversation

kluver
Copy link
Contributor

@kluver kluver commented Aug 20, 2024

No description provided.

@kluver kluver requested a review from karlhigley August 20, 2024 14:56
@kluver kluver self-assigned this Aug 20, 2024


class DatabaseRepository:
_repository_types = {}
_repository_types = set()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched to set since we don't care what the parameter is named anymore -- this does formally require annotating parameters, but working with this type of magic that's probably for the best.

@wraps(handler)
def wrapper(event, context):
with DB_ENGINE.connect() as conn:
# this will be a dictionary containing all parameters (with type annotations)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could probably be a type annotation along the lines of dict[str, type]

@kluver kluver merged commit d99fe8c into karl/refactor/repository-registration Aug 20, 2024
2 checks passed
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