File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
src/eligibility_signposting_api/repos Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def boto3_session_factory(
2222 )
2323
2424
25- @service
25+ @service ( qualifier = "dynamodb" )
2626def dynamodb_resource_factory (
2727 session : Session , dynamodb_endpoint : Annotated [URL , Inject (param = "dynamodb_endpoint" )]
2828) -> ServiceResource :
Original file line number Diff line number Diff line change 11import logging
2- from typing import Any
2+ from typing import Annotated , Any
33
44from boto3 .resources .base import ServiceResource
5- from wireup import service
5+ from wireup import Inject , service
66
77from eligibility_signposting_api .model .person import Name , Person
88from eligibility_signposting_api .repos .exceptions import NotFoundError
99
1010logger = logging .getLogger (__name__ )
1111
1212
13- @service
14- def people_table_factory (dynamodb_resource : ServiceResource ) -> Any :
13+ @service ( qualifier = "people_table" )
14+ def people_table_factory (dynamodb_resource : Annotated [ ServiceResource , Inject ( qualifier = "dynamodb" )] ) -> Any :
1515 table = dynamodb_resource .Table ("People" ) # type: ignore[reportAttributeAccessIssue]
1616 logger .info ("built people_table: %r" , table )
1717 return table
1818
1919
2020@service
2121class PersonRepo :
22- def __init__ (self , people_table : Any ) -> None :
22+ def __init__ (self , people_table : Annotated [ Any , Inject ( qualifier = "people_table" )] ) -> None :
2323 super ().__init__ ()
2424 self .people_table = people_table
2525
You can’t perform that action at this time.
0 commit comments