python-dependency-injector icon indicating copy to clipboard operation
python-dependency-injector copied to clipboard

dependency_injector.wiring.Provide object at 0x...

Open acscott opened this issue 3 years ago • 1 comments

Version 4.39.1 Instead of providing the configuration value it returns <dependency_injector.wiring.Provide object at 0x...>

config is setup as shown config = providers.Configuration( yaml_files="default.yaml") and default.yaml does exist.

and a call that relies on the dependency looks as below

@inject
def get_consistency_level( consistency_level: str = Provide["config.external.cassandra.parameters.consistency_level"],)

But consistency_level is set to <dependency_injector.wiring.Provide object at 0x7f9b1f9d8d60 Or in other words the dependency injection is not working.

Any tips on fixing this or how to go about debugging this?

acscott avatar May 17 '22 22:05 acscott

I have the same issue here.

stevenengland avatar Mar 29 '23 04:03 stevenengland