fix: Add policies to adapters (backport #4277) (#4279)
Some checks failed
Integration Tests (Replay) / generate-matrix (push) Successful in 4s
SqlStore Integration Tests / test-postgres (3.12) (push) Failing after 6s
Vector IO Integration Tests / test-matrix (push) Failing after 13s
Integration Auth Tests / test-matrix (oauth2_token) (push) Failing after 16s
SqlStore Integration Tests / test-postgres (3.13) (push) Failing after 45s
Unit Tests / unit-tests (3.12) (push) Failing after 54s
Integration Tests (Replay) / Integration Tests (, , , client=, ) (push) Failing after 20s
Unit Tests / unit-tests (3.13) (push) Failing after 2m11s
Pre-commit / pre-commit (push) Successful in 3m0s

The configured policy wasn't being passed in and instead the default was
being used (e.g. in the s3 file provider)

Closes: #4276
<hr>This is an automatic backport of pull request #4277 done by
[Mergify](https://mergify.com).

Signed-off-by: Derek Higgins <derekh@redhat.com>
Co-authored-by: Derek Higgins <derekh@redhat.com>
This commit is contained in:
mergify[bot] 2025-12-02 13:27:54 -08:00 committed by GitHub
parent 63e2e7534f
commit 9b68b38c55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -391,6 +391,9 @@ async def instantiate_provider(
method = "get_adapter_impl"
args = [config, deps]
if "policy" in inspect.signature(getattr(module, method)).parameters:
args.append(policy)
elif isinstance(provider_spec, AutoRoutedProviderSpec):
method = "get_auto_router_impl"