[PR #6] [CLOSED] chore: storage get non-existent key will not raise error #79

Closed
opened 2026-02-15 21:15:40 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/6
Author: @hjlarry
Created: 12/22/2024
Status: Closed

Base: mainHead: p1


📝 Commits (1)

  • 6a05b07 storage get non-existent key will not raise error

📊 Changes

1 file changed (+16 additions, -13 deletions)

View changed files

📝 python/dify_plugin/invocations/storage.py (+16 -13)

📄 Description

when we use item.get(key) method of a python dict or redis, it will not raise error.

So I think the interface should keep consistency.

Then we can use

if item:= self.session.storage.get(key):
    ...

instead of try...catch...


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugin-sdks/pull/6 **Author:** [@hjlarry](https://github.com/hjlarry) **Created:** 12/22/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `p1` --- ### 📝 Commits (1) - [`6a05b07`](https://github.com/langgenius/dify-plugin-sdks/commit/6a05b072be416e523ac1a1f36e03e309345c6ed2) storage get non-existent key will not raise error ### 📊 Changes **1 file changed** (+16 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `python/dify_plugin/invocations/storage.py` (+16 -13) </details> ### 📄 Description when we use `item.get(key)` method of a python dict or redis, it will not raise error. So I think the interface should keep consistency. Then we can use ``` if item:= self.session.storage.get(key): ... ``` instead of try...catch... --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 21:15:40 -05:00
yindo closed this issue 2026-02-15 21:15:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-sdks#79