Skip to content

Commit 35aa98b

Browse files
authored
fix(sdk-py): use correct f-string representation when loading error (#6388)
Thank you for contributing to LangGraph! Follow these steps to mark your pull request as ready for review. **If any of these steps are not completed, your PR will not be considered for review.** ## Description - Fixed a bug in `libs/sdk-py/langgraph_sdk/auth/__init__.py` where the error message for an already-set authentication handler did not properly render the handler value. - Updated the error string from a static `{self._authenticate_handler}` to a correctly interpolated f-string. ```python "Authentication handler already set as {self._authenticate_handler}." ``` ```python f"Authentication handler already set as {self._authenticate_handler}." ``` - Error messages now correctly display the actual handler instance, improving debugging clarity. - **Issue:** Fixes #6387 - **Dependencies:** - - **Twitter handle:** - - [x] **Add tests and docs**: If you're adding a new integration, you must include: 1. A test for the integration, preferably unit tests that do not rely on network access, 2. An example notebook showing its use. It lives in `docs/docs/integrations` directory. - [ ] **Lint and test**: Run `make format`, `make lint` and `make test` from the root of the package(s) you've modified. We will not consider a PR unless these three are passing in CI. See [contribution guidelines](https://github.com/langchain-ai/langgraph/blob/main/CONTRIBUTING.md) for more. Additional guidelines: - Make sure optional dependencies are imported within a function. - Please do not add dependencies to `pyproject.toml` files (even optional ones) unless they are **required** for unit tests. - Most PRs should not touch more than one package. - Changes should be backwards compatible.
1 parent 0f83d9f commit 35aa98b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/sdk-py/langgraph_sdk/auth/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ async def authenticate(
259259
"""
260260
if self._authenticate_handler is not None:
261261
raise ValueError(
262-
"Authentication handler already set as {self._authenticate_handler}."
262+
f"Authentication handler already set as {self._authenticate_handler}."
263263
)
264264
self._authenticate_handler = fn
265265
return fn

0 commit comments

Comments
 (0)