From 20b17dd2b700da684685f306ad35f62cd016c93c Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Mon, 11 Nov 2024 09:06:06 -0800 Subject: [PATCH] Fix check for update --- python/langsmith/client.py | 3 +-- python/tests/unit_tests/test_run_helpers.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/python/langsmith/client.py b/python/langsmith/client.py index e6d9ef288..eb397b4c4 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -5646,8 +5646,7 @@ def push_prompt( # Create or update prompt metadata if self._prompt_exists(prompt_identifier): if any( - param is not None - for param in [parent_commit_hash, is_public, description, readme, tags] + param is not None for param in [is_public, description, readme, tags] ): self.update_prompt( prompt_identifier, diff --git a/python/tests/unit_tests/test_run_helpers.py b/python/tests/unit_tests/test_run_helpers.py index a83f4413a..dbbbe1adf 100644 --- a/python/tests/unit_tests/test_run_helpers.py +++ b/python/tests/unit_tests/test_run_helpers.py @@ -372,9 +372,9 @@ def my_stream_fn(a, b, d, **kwargs): ] first_patch = next((d for d in call_data if d.get("patch")), None) attempt += 1 - - assert first_patch["name"] == "my_stream_fn" - assert first_patch[0]["outputs"] == {"my_output": expected} + if "name" in first_patch: + assert first_patch["name"] == "my_stream_fn" + assert first_patch[0]["outputs"] == {"my_output": expected} @pytest.mark.parametrize("use_next", [True, False])