Skip to content

Commit 6b8d83b

Browse files
Lin-Nikaidocopybara-github
authored andcommitted
fix: google#2883 pickle data was truncated error in database session using MySql
Merge google#2884 closes: google#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=google#2884 from Lin-Nikaido:fix/google#2883-mysql-datatype-fix 2be9b38 PiperOrigin-RevId: 819891727
1 parent 3639c14 commit 6b8d83b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎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)