fix: unwrap original key when its wrapped to not duplicate dependency#226
fix: unwrap original key when its wrapped to not duplicate dependency#226lucasfrancaid wants to merge 2 commits intoLancetnik:mainfrom
Conversation
|
@lucasfrancaid thank you for the report, but I am not sure, that you are using FastDepends correctly. You shouldn't wrap a function to Please, read #179 (comment) |
|
@Lancetnik, got it. But n the real scenario, I need to wrap the function with The problem I faced was solved by using Anyway, if it does not make any sense, sorry for waste your time. |
|
@lucasfrancaid np, I'll review and merge the PR. Just wanted to know about your case |
When working with

dependency_provider.overrideI had problems when trying to override a dependency function. During debugging, I noticed that dependency_provider was creating a new dependency with override instead of override the original function, see the image below:After getting deeper into the library code, I realised that when a dependency was created, the function name (used as key) was unwrapped so as not to register the

@injectinstead of the dependency function. See the image below to understand the injection structure:This pull request adds an unwrapping handler to the
Provider.__get_original_keymethod to ensure that the key is treated in the same way asbuild_call_modeldoes.