Skip to content

Commit 36c96ec

Browse files
Lin-Nikaidocopybara-github
authored andcommitted
fix: #2883 pickle data was truncated error in database session using MySql
Merge #2884 closes: #2883 # Fix When put leage data into event and load it. the _pickle.UnpicklingError was occurred. The root caurse is `DynamicPickleType` mapping `BLOB` as default in case of MySql, not `LONGBLOB`. And learge data will be able to cut off tail of data. And raise pickle error. # What todo Defined `LONFBLOB` as default explicitly. # Question Where should we code the test code like this case? I cannot found the test code the DB and table was created expectedly. COPYBARA_INTEGRATE_REVIEW=#2884 from Lin-Nikaido:fix/#2883-mysql-datatype-fix 2be9b38 PiperOrigin-RevId: 819891727
1 parent a985cc3 commit 36c96ec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/google/adk/sessions/database_session_service.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ class DynamicPickleType(TypeDecorator):
112112
impl = PickleType
113113

114114
def load_dialect_impl(self, dialect):
115+
if dialect.name == "mysql":
116+
return dialect.type_descriptor(mysql.LONGBLOB)
115117
if dialect.name == "spanner+spanner":
116118
from google.cloud.sqlalchemy_spanner.sqlalchemy_spanner import SpannerPickleType
117119

0 commit comments

Comments
 (0)