This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-agents.git
The following commit(s) were added to refs/heads/main by this push:
new 7aa5a46 [hotfix] Fix the inconsistency of the MemoryObject get method
in Local and Flink mode (#235)
7aa5a46 is described below
commit 7aa5a46071ecc8cb5e52e51c9e2c94288d501b24
Author: Eugene <[email protected]>
AuthorDate: Mon Sep 29 21:38:32 2025 +0800
[hotfix] Fix the inconsistency of the MemoryObject get method in Local and
Flink mode (#235)
---
python/flink_agents/e2e_tests/my_agent.py | 2 +-
python/flink_agents/runtime/flink_memory_object.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/python/flink_agents/e2e_tests/my_agent.py
b/python/flink_agents/e2e_tests/my_agent.py
index 8b25a08..d671ae7 100644
--- a/python/flink_agents/e2e_tests/my_agent.py
+++ b/python/flink_agents/e2e_tests/my_agent.py
@@ -101,7 +101,7 @@ class DataStreamAgent(Agent):
content.memory_info = {"total_reviews": total}
data_ref = stm.set(f"processed_items.item_{content.id}", content)
- ctx.send_event(MyEvent(value=data_ref.model_dump()))
+ ctx.send_event(MyEvent(value=data_ref))
@action(MyEvent)
@staticmethod
diff --git a/python/flink_agents/runtime/flink_memory_object.py
b/python/flink_agents/runtime/flink_memory_object.py
index 8fefddb..0b166a1 100644
--- a/python/flink_agents/runtime/flink_memory_object.py
+++ b/python/flink_agents/runtime/flink_memory_object.py
@@ -43,8 +43,8 @@ class FlinkMemoryObject(MemoryObject):
"""
try:
path_to_get: str
- if isinstance(path_or_ref, dict) and 'path' in path_or_ref:
- path_to_get = path_or_ref['path']
+ if isinstance(path_or_ref, MemoryRef):
+ path_to_get = path_or_ref.path
elif isinstance(path_or_ref, str):
path_to_get = path_or_ref
j_result = self._j_memory_object.get(path_to_get)