Skip to content

Conversation

@npage902
Copy link

Replaces #33618

Description: Fixes the bug in the load() function where secret placeholders in plain dicts were not replaced, even if they match a key in secrets_map, and adds a test case.

Example:

obj = {"api_key": "__SECRET_API_KEY__"}
secret_key = "secret_key_1234"
secrets_map = {"__SECRET_API_KEY__": secret_key}
result = load(obj, secrets_map=secrets_map)

Before this change, printing api_key in result would output "__SECRET_API_KEY__". Now, it will properly output "secret_key_1234".

Issue: Fixes #31804

Dependencies: None

make format, make lint, and make test have all passed on my machine.

@npage902 npage902 requested a review from eyurtsev as a code owner October 26, 2025 18:53
@github-actions github-actions bot added core Related to the package `langchain-core` langchain Related to the package `langchain` fix labels Oct 26, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 26, 2025

CodSpeed Performance Report

Merging #33678 will not alter performance

Comparing npage902:npage902/fix-load-secrets-map (34e85fb) with master (f3d7152)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched
⏩ 21 skipped1

Footnotes

  1. 21 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@npage902
Copy link
Author

Apologies for any confusion thanks to my last PR. Now, hopefully everything should be working fine. I'm still learning how to do open source contributions, so please let me know if there are any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Related to the package `langchain-core` fix langchain Related to the package `langchain`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

load() does not apply secrets_map to plain string values

1 participant