JinkunLiu commented on code in PR #950:
URL: https://github.com/apache/flink-agents/pull/950#discussion_r3743271920
##########
python/flink_agents/api/events/event.py:
##########
@@ -72,11 +74,14 @@ class Event(BaseModel, extra="allow"):
Event type string used for routing. Required for all events.
attributes : Dict[str, Any]
Key-value properties for the event data.
+ attachments : Dict[str, Any]
+ Key-value data passed between actions through sensory memory.
"""
id: UUID = Field(default=None)
type: str
attributes: Dict[str, Any] = Field(default_factory=dict)
+ attachments: Dict[str, Any] = Field(default_factory=dict)
Review Comment:
Yes, this is a clear bug, and I have fixed it.
While working on the fix, I also noticed that Python generated event IDs
from an MD5 hash of serialized event content. As a result, two events with
identical attributes could receive the same ID, which could cause attachment
values to overwrite each other because their MemoryRef paths are derived from
the event ID.
I have also updated Python to generate event IDs with uuid.uuid4(), matching
Java’s UUID.randomUUID() behavior. If Java and Python intentionally used
different ID-generation strategies for historical reasons, please let me know.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]